Пример #1
0
	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('restore') + rb.than('from') + rb.endsWith('backup')
		regexp = re.compile(regexpSource, re.UNICODE)

		match = regexp.match(line)
		return match, regexpSource
Пример #4
0
	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):
		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
Пример #7
0
	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
Пример #8
0
	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