5 PKG =
'([^\.;]+)(\.?[^;]*)?' 6 PYTHON1 =
'^import ' + PKG
7 PYTHON2 =
'from ' + PKG +
' import .*' 8 CPLUS = re.compile(
'#include\s*[<\\"]([^/]*)/?([^/]*)[>\\"]')
9 CPLUS2 = re.compile(
'#include\s*[<\\"]([^/]*)/([^/]*)/([^/]*)[>\\"]')
10 ROSCPP = re.compile(
'#include\s*<ros/ros.h>')
12 EXPRESSIONS = [re.compile(PYTHON1), re.compile(PYTHON2), CPLUS, CPLUS2]
16 return s[0:2] ==
'#!' and 'python' in s
32 parts = os.path.split(rel_fn)
33 if parts
and parts[0] ==
'test':
43 self.
lines = map(unicode.strip, unicode(contents).split(
'\n'))
48 for pattern
in patterns:
49 matches += pattern.findall(contents)
54 for line
in self.
lines:
55 for pattern
in patterns:
56 m = pattern.search(line)
58 matches.append(m.groups())
70 return sorted(list(pkgs))
94 return self.
rel_fn < other.rel_fn
98 return '%s (%s)' % (self.
rel_fn,
', '.join(attribs))
def is_python_hashbang_line(s)
def get_python_dependency(key)
def search_lines_for_patterns(self, patterns)
def replace_contents(self, contents)
def search_for_patterns(self, patterns)
def get_dependencies(self)
def get_external_python_dependencies(self)
def get_import_packages(self)
def search_lines_for_pattern(self, pattern)
def __init__(self, rel_fn, file_path)