Lines Matching full:path
172 top_level_dir = os.path.abspath(top_level_dir)
174 if not top_level_dir in sys.path:
177 # in sys.path to minimise likelihood of conflicts between installed
179 sys.path.insert(0, top_level_dir)
183 if os.path.isdir(os.path.abspath(start_dir)):
184 start_dir = os.path.abspath(start_dir)
186 is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
196 start_dir = os.path.abspath(os.path.dirname((the_module.__file__)))
199 sys.path.remove(top_level_dir)
209 full_path = os.path.abspath(module.__file__)
211 if os.path.basename(full_path).lower().startswith('__init__.py'):
212 return os.path.dirname(os.path.dirname(full_path))
217 return os.path.dirname(full_path)
219 def _get_name_from_path(self, path):
220 path = os.path.splitext(os.path.normpath(path))[0]
222 _relpath = os.path.relpath(path, self._top_level_dir)
223 assert not os.path.isabs(_relpath), "Path must be within the project"
224 assert not _relpath.startswith('..'), "Path must be within the project"
226 name = _relpath.replace(os.path.sep, '.')
233 def _match_path(self, path, full_path, pattern):
235 return fnmatch(path, pattern)
241 for path in paths:
242 full_path = os.path.join(start_dir, path)
243 if os.path.isfile(full_path):
244 if not VALID_MODULE_NAME.match(path):
247 if not self._match_path(path, full_path, pattern):
256 mod_file = os.path.abspath(getattr(module, '__file__', full_path))
257 realpath = os.path.splitext(mod_file)[0]
258 fullpath_noext = os.path.splitext(full_path)[0]
260 module_dir = os.path.dirname(realpath)
261 mod_name = os.path.splitext(os.path.basename(full_path))[0]
262 expected_dir = os.path.dirname(full_path)
267 elif os.path.isdir(full_path):
268 if not os.path.isfile(os.path.join(full_path, '__init__.py')):
273 if fnmatch(path, pattern):