BuildScript/scripts/parser/SettingsParser/PathParser.py

15 lines
321 B
Python

class PathParser:
def parse(self, line):
assert line is not None
pathSegments = line.split('.')
self._guardPathSegments(pathSegments, line)
return pathSegments
def _guardPathSegments(self, pathSegments, sourceLine):
if '' in pathSegments:
raise Exception('invalid path given: {0}'.format(sourceLine))