本文整理汇总了Python中CeciliaLib.openCeciliaFile方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.openCeciliaFile方法的具体用法?Python CeciliaLib.openCeciliaFile怎么用?Python CeciliaLib.openCeciliaFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CeciliaLib
的用法示例。
在下文中一共展示了CeciliaLib.openCeciliaFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: openRecent
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import openCeciliaFile [as 别名]
def openRecent(self, event):
menu = self.GetMenuBar()
id = event.GetId()
file = menu.FindItemById(id).GetLabel()
if os.path.isfile(file[:-1]):
CeciliaLib.openCeciliaFile(self, file[:-1])
self.updateTitle()
else:
CeciliaLib.showErrorDialog("Error while trying to open a file!", "No such file : %s" % file[:-1])
self.newRecent(file[:-1], remove=True)
示例2: onOpenBuiltin
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import openCeciliaFile [as 别名]
def onOpenBuiltin(self, event):
menu = self.GetMenuBar()
id = event.GetId()
file = menu.FindItemById(id)
filename = file.GetLabel()
filedict = self.GetMenuBar().files
for key in filedict.keys():
if filename in filedict[key]:
dirname = key
break
name = os.path.join(CeciliaLib.ensureNFD(MODULES_PATH), dirname, filename)
CeciliaLib.openCeciliaFile(self, name, True)
self.updateTitle()
示例3: onOpenPrefModule
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import openCeciliaFile [as 别名]
def onOpenPrefModule(self, event):
menu = self.GetMenuBar()
id = event.GetId()
file = menu.FindItemById(id)
filename = file.GetLabel()
filedir = file.GetMenu().GetTitle()
prefPath = CeciliaLib.getVar("prefferedPath")
prefPaths = prefPath.split(';')
prefBaseNames = [os.path.basename(path) for path in prefPaths]
dirname = prefPaths[prefBaseNames.index(filedir)]
if dirname:
name = os.path.join(dirname, filename)
CeciliaLib.openCeciliaFile(self, name)
self.updateTitle()
示例4: reloadCurrentModule
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import openCeciliaFile [as 别名]
def reloadCurrentModule(self, event):
CeciliaLib.openCeciliaFile(self, CeciliaLib.getVar("currentCeciliaFile"))
self.updateTitle()
示例5: onOpen
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import openCeciliaFile [as 别名]
def onOpen(self, event, builtin=False):
if isinstance(event, wx.CommandEvent):
CeciliaLib.openCeciliaFile(self)
elif os.path.isfile(event):
CeciliaLib.openCeciliaFile(self, event, builtin)
self.updateTitle()