Пример #1
0
	def check_pattern_in_lines(self, lines):
		for pattern in self.patterns.get_patterns():
			for (content) in re.findall(pattern, lines):
				words = content.split('\n')
				for word in words:
					if Constants.EQUAL in word:
						word = word.split(Constants.EQUAL)[0].strip()
						out = (word, word)
						AutocompleteList.append(out)
Пример #2
0
	def find_methods_in_line(self, line, number, fn):
		if (Constants.FUNCTION in line) and (
			(Constants.POINT in line) or (Constants.COLON in line)):
			
			for pattern in self.patterns.get_patterns():
				match = pattern.search(line)
				if match:
					method = match.group(0)
					
					start_pos = line.find(Constants.COLON)
					if (start_pos < 0):
						start_pos = line.find(Constants.POINT)
					end_pos = line.find(')')
					if ((start_pos > 0) and (end_pos > start_pos)):
						subs = line[start_pos + 1 : end_pos + 1]
	
						method = re.sub("[.:\(\)]", ' ', method).strip().split()
						method = method[2]
						out = (method, subs)
	
					AutocompleteList.append(out)
Пример #3
0
    def find_methods_in_line(self, line, number, fn):
        if (Constants.FUNCTION in line) and ((Constants.POINT in line) or
                                             (Constants.COLON in line)):

            for pattern in self.patterns.get_patterns():
                match = pattern.search(line)
                if match:
                    method = match.group(0)

                    start_pos = line.find(Constants.COLON)
                    if (start_pos < 0):
                        start_pos = line.find(Constants.POINT)
                    end_pos = line.find(')')
                    if ((start_pos > 0) and (end_pos > start_pos)):
                        subs = line[start_pos + 1:end_pos + 1]

                        method = re.sub("[.:\(\)]", ' ',
                                        method).strip().split()
                        method = method[2]
                        out = (method, subs)

                    AutocompleteList.append(out)