Skip to content
Permalink
Browse files

[processing] add group id to scripts

  • Loading branch information
alexbruy committed Dec 14, 2017
1 parent dca37ab commit 2674022b6cfbaab6754de3517024bc3ae9599b24
Showing with 5 additions and 0 deletions.
  1. +5 −0 python/plugins/processing/script/ScriptAlgorithm.py
@@ -62,6 +62,7 @@ def __init__(self, descriptionFile, script=None):
self._name = ''
self._display_name = ''
self._group = ''
self._groupId = ''
self._flags = None

self.script = script
@@ -111,6 +112,7 @@ def defineCharacteristicsFromFile(self):
self._name = filename[:filename.rfind('.')].replace('_', ' ')
self._display_name = self._name
self._group = self.tr('User scripts', 'ScriptAlgorithm')
self._groupId = 'userscripts'
with open(self.descriptionFile) as lines:
line = lines.readline()
while line != '':
@@ -130,6 +132,7 @@ def defineCharacteristicsFromScript(self):
self._name = '[Unnamed algorithm]'
self._display_name = self.tr('[Unnamed algorithm]', 'ScriptAlgorithm')
self._group = self.tr('User scripts', 'ScriptAlgorithm')
self._groupId = 'userscripts'
for line in lines:
if line.startswith('##'):
try:
@@ -163,6 +166,8 @@ def processParameterLine(self, line):
desc = self.createDescriptiveName(tokens[0])
if tokens[1].lower().strip() == 'group':
self._group = tokens[0]
validChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:'
self._groupId = ''.join(c for c in tokens[0].lower() if c in validChars)
return
if tokens[1].lower().strip() == 'name':
self._name = self._display_name = tokens[0]

0 comments on commit 2674022

Please sign in to comment.
You can’t perform that action at this time.