Lines Matching refs:path
17 import os.path
30 def __init__(self, path, error): argument
31 self.path = path
36 return "Failure determining dependencies of {}: {}".format(self.path, self.error)
52 def walk_up(path): argument
53 while path:
54 yield path
55 path, _, _ = path.rpartition(os.sep)
58 def get_provides(path): argument
59 path = os.path.realpath(path)
66 isdir = os.path.isdir(path)
68 pkg_path = path
69 walk_path = path
71 pkg_path = get_fn_name(path)
74 walk_path = os.path.dirname(path)
77 if not os.path.exists(os.path.join(curpath, '__init__.py')):
86 yield package, path
88 if os.path.exists(os.path.join(path, '__init__.py')):
89 yield package, path
91 for dirpath, dirnames, filenames in os.walk(path):
92 relpath = dirpath[len(path)+1:]
110 fullfn = os.path.join(dirpath, fn)
117 def get_code_depends(code_string, path=None, provide=None, ispkg=False): argument
119 code = ast.parse(code_string, path)
121 raise DependError(path, exc)
123 raise DependError(path, exc)
136 package_path = os.path.dirname(path)
144 if context and path:
145 module_basepath = os.path.join(package_path, module.replace('.', '/'))
146 if os.path.exists(module_basepath):
148 yield context + '.' + module, path
152 if os.path.exists(module_basepath + suffix):
154 yield context + '.' + module, path
157 yield module, path
159 yield module, path
165 …("Error: ImportFrom non-zero level outside of a package: {0}".format((module, names, level)), path)
167 …endError("Error: ImportFrom level exceeds package depth: {0}".format((module, names, level)), path)
172 yield context + '.' + module, path
174 yield module, path
177 def get_file_depends(path): argument
179 code_string = open(path, 'r').read()
181 raise DependError(path, exc)
183 return get_code_depends(code_string, path)
187 directory = os.path.realpath(directory)
191 if os.path.isdir(filename):
192 filename = os.path.join(filename, '__init__.py')
207 def get_depends(path): argument
208 if os.path.isdir(path):
209 return get_depends_recursive(path)
211 return get_file_depends(path)
228 for path in args.path:
229 for provide, fn in get_provides(path):
235 for path in args.path:
237 modules = get_depends(path)