本文整理汇总了Python中PySide.QtCore.QDir.entryInfoList方法的典型用法代码示例。如果您正苦于以下问题:Python QDir.entryInfoList方法的具体用法?Python QDir.entryInfoList怎么用?Python QDir.entryInfoList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore.QDir
的用法示例。
在下文中一共展示了QDir.entryInfoList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __readPluginPaths
# 需要导入模块: from PySide.QtCore import QDir [as 别名]
# 或者: from PySide.QtCore.QDir import entryInfoList [as 别名]
def __readPluginPaths(self):
self.pluginCategories.clear()
self.pluginSpecs[:] = []
specFiles = []
searchPaths = self.pluginPaths
print("Append plugin spec files:")
while searchPaths:
searchDir = QDir(searchPaths.pop(0))
pattern = "*." + self.extension
fileInfoList = searchDir.entryInfoList([pattern], QDir.Files)
for fileInfo in fileInfoList:
print(BColors.DARKCYAN + fileInfo.absoluteFilePath() + BColors.ENDC)
specFiles.append(fileInfo.absoluteFilePath())
dirInfoList = searchDir.entryInfoList(QDir.Dirs | QDir.NoDotAndDotDot)
for dirInfo in dirInfoList:
searchPaths.append(dirInfo.absoluteFilePath())
self.defaultCollection = PluginCollection("")
self.pluginCategories[""] = self.defaultCollection
for specFile in specFiles:
spec = PluginSpec(self)
spec.private.read(specFile)
if spec.category() in self.pluginCategories:
collection = self.pluginCategories[spec.category()]
else:
collection = PluginCollection(spec.category())
self.pluginCategories[spec.category()] = collection
if spec.isExperimental() and (spec.name() in self.forceEnabledPlugins):
spec.setEnabled(True)
if not spec.isExperimental() and (spec.name() in self.disabledPlugins):
spec.setEnabled(False)
collection.addPlugin(spec)
self.pluginSpecs.append(spec)
self.resolveDependencies()
self.pluginManager.pluginsChanged.emit()