Skip to content

Commit 6f43954

Browse files
committed
[processing] add group id to GRASS algorithms
1 parent 1d482cf commit 6f43954

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/plugins/processing/algs/grass7/Grass7Algorithm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import sys
2929
import os
30+
import re
3031
import uuid
3132
import importlib
3233

@@ -98,6 +99,8 @@ def __init__(self, descriptionfile):
9899
self._name = ''
99100
self._display_name = ''
100101
self._group = ''
102+
self._groupId = ''
103+
self.groupIdRegex = re.compile('^[^\s\(]+')
101104
self.grass7Name = ''
102105
self.params = []
103106
self.hardcodedStrings = []
@@ -138,6 +141,9 @@ def displayName(self):
138141
def group(self):
139142
return self._group
140143

144+
def groupId(self):
145+
return self._groupId
146+
141147
def icon(self):
142148
return QgsApplication.getThemeIcon("/providerGrass.svg")
143149

@@ -191,6 +197,7 @@ def defineCharacteristicsFromFile(self):
191197
# Read the grass group
192198
line = lines.readline().strip('\n').strip()
193199
self._group = QCoreApplication.translate("GrassAlgorithm", line)
200+
self._groupId = self.groupIdRegex.search(line).group(0).lower()
194201
hasRasterOutput = False
195202
hasRasterInput = False
196203
hasVectorInput = False

0 commit comments

Comments
 (0)