Добавил возможность запускать sh комманду из скрипта
This commit is contained in:
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
from parser.LineParser import LineParser
|
||||
import re
|
||||
|
||||
class ShParser(LineParser):
|
||||
def parseLine(self, line):
|
||||
assert line
|
||||
|
||||
cmdTextRegexp = r'(?P<text>.*)'
|
||||
|
||||
regexpSource = self.startsWithKeywordToken('sh') + cmdTextRegexp
|
||||
regexp = re.compile(regexpSource, re.UNICODE)
|
||||
|
||||
match = regexp.match(line)
|
||||
self._guardMatch(match, line, regexpSource)
|
||||
|
||||
cmdText = match.group('text')
|
||||
return cmdText
|
||||
|
||||
def isValidLine(self, line):
|
||||
assert line is not None
|
||||
|
||||
return line.startswith('sh ')
|
||||
Reference in New Issue
Block a user