本文整理匯總了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()