本文整理汇总了Python中PyQt4.Qsci.QsciAPIs.defaultPreparedName方法的典型用法代码示例。如果您正苦于以下问题:Python QsciAPIs.defaultPreparedName方法的具体用法?Python QsciAPIs.defaultPreparedName怎么用?Python QsciAPIs.defaultPreparedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qsci.QsciAPIs
的用法示例。
在下文中一共展示了QsciAPIs.defaultPreparedName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: APIs
# 需要导入模块: from PyQt4.Qsci import QsciAPIs [as 别名]
# 或者: from PyQt4.Qsci.QsciAPIs import defaultPreparedName [as 别名]
#.........这里部分代码省略.........
res = self.__apis.savePrepared()
self.__inPreparation = False
self.emit(SIGNAL('apiPreparationFinished()'))
def __apiPreparationCancelled(self):
"""
Private method called, after the API preparation process has been cancelled.
"""
self.__inPreparation = False
self.emit(SIGNAL('apiPreparationCancelled()'))
def __apiPreparationStarted(self):
"""
Private method called, when the API preparation process started.
"""
self.__inPreparation = True
self.emit(SIGNAL('apiPreparationStarted()'))
def prepareAPIs(self, ondemand = False, rawList = None):
"""
Public method to prepare the APIs if necessary.
@keyparam ondemand flag indicating a requested preparation (boolean)
@keyparam rawList list of raw API files (QStringList)
"""
if self.__apis is None or self.__inPreparation:
return
needsPreparation = False
if ondemand:
needsPreparation = True
else:
# check, if a new preparation is necessary
preparedAPIs = self.__defaultPreparedName()
if not preparedAPIs.isEmpty():
preparedAPIsInfo = QFileInfo(preparedAPIs)
if not preparedAPIsInfo.exists():
needsPreparation = True
else:
preparedAPIsTime = preparedAPIsInfo.lastModified()
apifiles = Preferences.getEditorAPI(self.__language)
apifiles.sort()
if self.__apifiles != apifiles:
needsPreparation = True
for apifile in apifiles:
if QFileInfo(apifile).lastModified() > preparedAPIsTime:
needsPreparation = True
break
if needsPreparation:
# do the preparation
self.__apis.clear()
if rawList:
apifiles = rawList
else:
apifiles = Preferences.getEditorAPI(self.__language)
for apifile in apifiles:
self.__apis.load(apifile)
self.__apis.prepare()
self.__apifiles = apifiles
def cancelPreparation(self):
"""
Public slot to cancel the APIs preparation.
"""
self.__apis and self.__apis.cancelPreparation()