Skip to content

Commit

Permalink
test models and scripts are now hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Sep 21, 2013
1 parent 56d6496 commit 1517e58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/plugins/processing/gui/ProcessingToolbox.py
Expand Up @@ -16,7 +16,7 @@
* *
***************************************************************************
"""
from processing import interface


__author__ = 'Victor Olaya'
__date__ = 'August 2012'
Expand All @@ -26,16 +26,14 @@

from PyQt4.QtCore import *
from PyQt4.QtGui import *

import webbrowser
from processing import interface
from processing.gui.MissingDependencyDialog import MissingDependencyDialog
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.modeler.Providers import Providers
from processing.gui.AlgorithmClassification import AlgorithmDecorator
from processing.core.Processing import Processing
from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingConfig import ProcessingConfig
from processing.tools import dataobjects
from processing.gui.ParametersDialog import ParametersDialog
from processing.gui.BatchProcessingDialog import BatchProcessingDialog
from processing.gui.EditRenderingStylesDialog import EditRenderingStylesDialog
Expand Down Expand Up @@ -302,6 +300,7 @@ def fillTreeUsingProviders(self):
text = unicode(self.searchBox.text())
for providerName in Processing.algs.keys():
groups = {}
count = 0
provider = Processing.algs[providerName]
name = "ACTIVATE_" + providerName.upper().replace(" ", "_")
if not ProcessingConfig.getSetting(name):
Expand All @@ -321,6 +320,7 @@ def fillTreeUsingProviders(self):
groups[alg.group] = groupItem
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)
count += 1

actions = Processing.actions[providerName]
for action in actions:
Expand All @@ -337,7 +337,7 @@ def fillTreeUsingProviders(self):
if len(groups) > 0:
providerItem = QTreeWidgetItem()
providerItem.setText(0, Processing.getProviderFromName(providerName).getDescription()
+ " [" + str(len(provider)) + " geoalgorithms]")
+ " [" + str(count) + " geoalgorithms]")
providerItem.setIcon(0, Processing.getProviderFromName(providerName).getIcon())
providerItem.setToolTip(0, providerItem.text(0))
for groupItem in groups.values():
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -139,6 +139,9 @@ def openModel(self, filename):
self.name = line[len("NAME:"):]
elif line.startswith("GROUP:"):
self.group = line[len("GROUP:"):]
if self.group == "[Test models]":
self.showInModeler = False
self.showInToolbox = False
elif line.startswith("ALGORITHM:"):
algParams={}
algOutputs={}
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/script/ScriptAlgorithm.py
Expand Up @@ -87,6 +87,9 @@ def defineCharacteristicsFromFile(self):
self.script += line
line = lines.readline()
lines.close()
if self.group == "[Test scripts]":
self.showInModeler = False
self.showInToolbox = False

def defineCharacteristicsFromScript(self):
lines = self.script.split("\n")
Expand Down

0 comments on commit 1517e58

Please sign in to comment.