def parseLine(self, line):
		assert line is not None

		rb = RegexpBuilder()

		notesRegexp = r"'(?P<notes>[^']+)'"
		apiTokenRegexp = r"'(?P<api_token>[^']+)'"
		teamTokenRegexp = r"'(?P<team_token>[^']+)'"
		filePathRegexp = r"'(?P<path>[^']+)'"

		regexpSource = rb.startsWith('publish') + filePathRegexp + rb.keywordToken('to') + rb.than('testflight') + \
					   rb.than('notes') + rb.than('=') + notesRegexp + \
					   rb.keywordToken('api_token') + rb.than('=') + apiTokenRegexp + \
					   rb.keywordToken('team_token') + rb.than('=') + teamTokenRegexp

		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		self._guardMatch(match, line, regexpSource)

		path = match.group('path')
		notes = match.group('notes')
		apiToken = match.group('api_token')
		teamToken = match.group('team_token')

		return {
			'path': path,
			'notes': notes,
			'api_token': apiToken,
			'team_token': teamToken
		}
	def isValidLine(self, line):
		rb = RegexpBuilder()

		regexpSource = rb.startsWith('install') + rb.than('profile')
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		return match is not None
	def getMatchInfo(self, line):
		assert line is not None

		rb = RegexpBuilder()
		regexpSource = rb.startsWith('delete') + rb.endsWith('backup')
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		return match, regexpSource
	def isValidLine(self, line):
		assert line is not None

		rb = RegexpBuilder()
		rSrc = rb.startsWith('sign') + rb.than('android')

		regexp = re.compile(rSrc, re.UNICODE)
		match = regexp.match(line)

		return match is not None
	def parseLine(self, line):
		pathRegexp = r"'(?P<path>[^']+)'$"

		rb = RegexpBuilder()
		regexpSource = rb.startsWith('create dirs') + pathRegexp
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		self._guardMatch(match, line, regexpSource)

		path = match.group('path')
		return path
	def getMatchInfo(self, line):
		assert line is not None

		filePathRegexp = r"'(?P<file>[./ a-zA-Z]+\.{0})'".format(self.fileExt)
		projectNameRegexp = r"'(?P<projects>[^']+)'"

		rb = RegexpBuilder()
		regexpSource = rb.startsWith('inside') + filePathRegexp + rb.keywordToken('remove') + projectNameRegexp + \
					   rb.spaceEndsWith('project(s)?')
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		return match, regexpSource
Example #7
0
	def parseLine(self, line):
		assert line

		rb = RegexpBuilder()
		cmdTextRegexp = r'(?P<text>.*)'

		regexpSource = rb.startsWith('sh') + cmdTextRegexp
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		self._guardMatch(match, line, regexpSource)

		cmdText = match.group('text')
		return cmdText
	def parseLine(self, line):
		assert line is not None

		rb = RegexpBuilder()
		profilePathRegexp = r"'(?P<path>[^']+)'$"
		regexpSource = rb.startsWith('install') + rb.than('profile') + profilePathRegexp

		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		self._guardMatch(match, line, regexpSource)

		srcPath = match.group('path')
		return srcPath
	def getMatchInfo(self, line):
		assert line is not None

		keyRegexp = r'(?P<key>[a-zA-Z]+)'
		valueRegexp = r"'(?P<values>[^']+)'$"

		rb = RegexpBuilder()
		regexpSource = rb.startsWith('inside') + self.filePathRegexp + rb.keywordToken('set') + keyRegexp + \
					   rb.keywordToken('with') + rb.than('values') + valueRegexp
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)

		return match, regexpSource
	def getIncludesInfo(self, text):
		assert text is not None

		rb = RegexpBuilder()
		regexpSource = '<\s*' + rb.than('include') + r"'[^']+'" + '\s*>'

		regexp = re.compile(regexpSource, re.UNICODE)
		results = regexp.findall(text)

		includesInfo = []
		if results:
			for r in results:
				path = self.getPathByIncludeStatement(r)
				includesInfo.append((r, path))

		return includesInfo
	def parseLine(self, line):
		assert line is not None

		filePathRegexp = r"'(?P<path>[./ a-zA-Z]+\.sln)'"
		slnConfigRegexp = r"'(?P<config>[a-zA-Z|]+)'$"

		rb = RegexpBuilder()
		regexpSource = rb.startsWith(self.commandToken) + filePathRegexp + rb.keywordToken('for') + slnConfigRegexp
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		self._guardMatch(match, line, regexpSource)

		path = match.group('path')
		slnConfig = match.group('config')

		return path, slnConfig
	def parseLine(self, line):
		assert line is not None

		srcFileNameRegexp = r"'(?P<src>[^']+)'"
		dstFileNameRegexp = r"'(?P<dst>[^']+)'$"

		rb = RegexpBuilder()
		regexpSource = rb.startsWith('copy') + srcFileNameRegexp + rb.keywordToken('to') + dstFileNameRegexp
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		self._guardMatch(match, line, regexpSource)

		src = match.group('src')
		dst = match.group('dst')

		self.__copyArguments.setArguments(src, dst)
		return self.__copyArguments
	def parseLine(self, line):
		assert line is not None

		filePathRegexp = r"'(?P<path>[./ a-zA-Z]+\.sln)'"
		slnConfigRegexp = r"'(?P<config>[a-zA-Z|]+)'"
		projectRegexp = r"'(?P<project>[.a-zA-Z]+)'$"

		rb = RegexpBuilder()
		rSrc = rb.startsWith('sign') + rb.than('android') + filePathRegexp + rb.keywordToken('for') + slnConfigRegexp +\
			   rb.keywordToken('project') + projectRegexp
		regexp = re.compile(rSrc, re.UNICODE)

		match = regexp.match(line)
		self._guardMatch(match, line, rSrc)

		path = match.group('path')
		slnConfig = match.group('config')
		project = match.group('project')

		return path, slnConfig, project