Public Member Functions | |
def | __init__ |
def | dump |
def | search |
Public Attributes | |
dependencies | |
hit | |
module | |
name | |
searched | |
stack |
Definition at line 50 of file TreeCrawler.py.
def TreeCrawler::Package::__init__ | ( | self, | |
name, | |||
top = False |
|||
) |
Definition at line 51 of file TreeCrawler.py.
def TreeCrawler::Package::dump | ( | self, | |
level | |||
) |
Definition at line 60 of file TreeCrawler.py.
def TreeCrawler::Package::search | ( | self, | |
pattern, | |||
result | |||
) |
recursive search for pattern in source files
Definition at line 67 of file TreeCrawler.py.
00068 : 00069 """ recursive search for pattern in source files""" 00070 # first start searching in the package itself / do this only once 00071 if self.module: 00072 for number, line in enumerate(inspect.getsource(self.module).splitlines()): 00073 if pattern in line: 00074 filename = packageNameFromFilename(inspect.getsourcefile(self.module)) 00075 if not self.searched: 00076 # save the hit, so we can add later stacks to it 00077 self.hit = SearchHit() 00078 self.hit.number = number 00079 self.hit.filename = filename 00080 self.hit.line = line 00081 self.hit.stacks = list() 00082 result.append(self.hit) 00083 self.hit.stacks.append(copy.copy(_stack)) 00084 # then go on with dependencies 00085 _stack.append(self.name) 00086 for package in self.dependencies: 00087 package.search(pattern,result) 00088 _stack.pop() 00089 self.searched = True 00090
Definition at line 51 of file TreeCrawler.py.
Definition at line 67 of file TreeCrawler.py.
Definition at line 51 of file TreeCrawler.py.
Definition at line 51 of file TreeCrawler.py.
Definition at line 51 of file TreeCrawler.py.
Definition at line 51 of file TreeCrawler.py.