本文整理汇总了Python中sextante.core.SextanteLog.SextanteLog.getRecentAlgorithms方法的典型用法代码示例。如果您正苦于以下问题:Python SextanteLog.getRecentAlgorithms方法的具体用法?Python SextanteLog.getRecentAlgorithms怎么用?Python SextanteLog.getRecentAlgorithms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sextante.core.SextanteLog.SextanteLog
的用法示例。
在下文中一共展示了SextanteLog.getRecentAlgorithms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addRecentAlgorithms
# 需要导入模块: from sextante.core.SextanteLog import SextanteLog [as 别名]
# 或者: from sextante.core.SextanteLog.SextanteLog import getRecentAlgorithms [as 别名]
def addRecentAlgorithms(self, updating):
showRecent = SextanteConfig.getSetting(SextanteConfig.SHOW_RECENT_ALGORITHMS)
if showRecent:
recent = SextanteLog.getRecentAlgorithms()
if len(recent) != 0:
found = False
if updating:
recentItem = self.algorithmTree.topLevelItem(0)
treeWidget = recentItem.treeWidget()
treeWidget.takeTopLevelItem(treeWidget.indexOfTopLevelItem(recentItem))
#self.algorithmTree.removeItemWidget(first, 0)
recentItem = QTreeWidgetItem()
recentItem.setText(0, self.tr("Recently used algorithms"))
for algname in recent:
alg = Sextante.getAlgorithm(algname)
if alg is not None:
algItem = TreeAlgorithmItem(alg)
recentItem.addChild(algItem)
found = True
if found:
self.algorithmTree.insertTopLevelItem(0, recentItem)
recentItem.setExpanded(True)
self.algorithmTree.setWordWrap(True)
示例2: fillTree
# 需要导入模块: from sextante.core.SextanteLog import SextanteLog [as 别名]
# 或者: from sextante.core.SextanteLog.SextanteLog import getRecentAlgorithms [as 别名]
def fillTree(self):
useCategories = SextanteConfig.getSetting(SextanteConfig.USE_CATEGORIES)
if useCategories:
self.fillTreeUsingCategories()
else:
self.fillTreeUsingProviders()
self.algorithmTree.sortItems(0, Qt.AscendingOrder)
showRecent = SextanteConfig.getSetting(SextanteConfig.SHOW_RECENT_ALGORITHMS)
if showRecent:
recent = SextanteLog.getRecentAlgorithms()
if len(recent) != 0:
found = False
recentItem = QTreeWidgetItem()
recentItem.setText(0, self.tr("Recently used algorithms"))
for algname in recent:
alg = Sextante.getAlgorithm(algname)
if alg is not None:
algItem = TreeAlgorithmItem(alg)
recentItem.addChild(algItem)
found = True
if found:
self.algorithmTree.insertTopLevelItem(0, recentItem)
recentItem.setExpanded(True)
self.algorithmTree.setWordWrap(True)
示例3: fillTree
# 需要导入模块: from sextante.core.SextanteLog import SextanteLog [as 别名]
# 或者: from sextante.core.SextanteLog.SextanteLog import getRecentAlgorithms [as 别名]
def fillTree(self):
self.algorithmTree.clear()
text = unicode(self.searchBox.text())
for providerName in Sextante.algs.keys():
groups = {}
provider = Sextante.algs[providerName]
name = "ACTIVATE_" + providerName.upper().replace(" ", "_")
if not SextanteConfig.getSetting(name):
continue
algs = provider.values()
#add algorithms
for alg in algs:
if not alg.showInToolbox:
continue
if text =="" or text.lower() in alg.name.lower():
if alg.group in groups:
groupItem = groups[alg.group]
else:
groupItem = QTreeWidgetItem()
groupItem.setText(0,alg.group)
groups[alg.group] = groupItem
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)
actions = Sextante.actions[providerName]
for action in actions:
if text =="" or text.lower() in action.name.lower():
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QTreeWidgetItem()
groupItem.setText(0,action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)
if len(groups) > 0:
providerItem = QTreeWidgetItem()
providerItem.setText(0, Sextante.getProviderFromName(providerName).getDescription()
+ " [" + str(len(provider)) + " geoalgorithms]")
providerItem.setIcon(0, Sextante.getProviderFromName(providerName).getIcon())
for groupItem in groups.values():
providerItem.addChild(groupItem)
self.algorithmTree.addTopLevelItem(providerItem)
providerItem.setExpanded(text!="")
for groupItem in groups.values():
if text != "":
groupItem.setExpanded(True)
self.algorithmTree.sortItems(0, Qt.AscendingOrder)
showRecent = SextanteConfig.getSetting(SextanteConfig.SHOW_RECENT_ALGORITHMS)
if showRecent:
recent = SextanteLog.getRecentAlgorithms()
if len(recent) != 0:
found = False
recentItem = QTreeWidgetItem()
recentItem.setText(0, self.tr("Recently used algorithms"))
for algname in recent:
alg = Sextante.getAlgorithm(algname)
if alg is not None:
algItem = TreeAlgorithmItem(alg)
recentItem.addChild(algItem)
found = True
if found:
self.algorithmTree.insertTopLevelItem(0, recentItem)
recentItem.setExpanded(True)
self.algorithmTree.setWordWrap(True)