Lines Matching refs:path
73 def cache_from_source(path, debug_override=None):
76 Given the path to a .py file, return the path to its .pyc file.
78 The .py file does not need to exist; this simply returns the path to the
89 return util.cache_from_source(path, debug_override)
92 def source_from_cache(path):
95 Given the path to a .pyc. file, return the path to its .py file.
97 The .pyc file does not need to exist; this simply returns the path to
98 the .py file calculated to correspond to the .pyc file. If path does
103 return util.source_from_cache(path)
123 def __init__(self, path):
124 if path == '':
125 raise ImportError('empty pathname', path='')
126 elif os.path.isdir(path):
127 raise ImportError('existing directory', path=path)
139 def __init__(self, fullname, path, file=None):
140 super().__init__(fullname, path)
143 def get_data(self, path):
145 if self.file and path == self.path:
153 self.file = file = open(self.path, 'rb')
158 return super().get_data(path)
200 def load_package(name, path):
202 if os.path.isdir(path):
206 init_path = os.path.join(path, '__init__' + extension)
207 if os.path.exists(init_path):
208 path = init_path
211 raise ValueError('{!r} is not a package'.format(path))
212 spec = util.spec_from_file_location(name, path,
255 def find_module(name, path=None):
260 If path is omitted or None, search for a built-in, frozen or special
261 module and continue search in sys.path. The module name cannot
268 elif not isinstance(path, (type(None), list)):
270 raise RuntimeError("'path' must be None or a list, "
271 "not {}".format(type(path)))
273 if path is None:
279 path = sys.path
281 for entry in path:
282 package_directory = os.path.join(entry, name)
285 file_path = os.path.join(package_directory, package_file_name)
286 if os.path.isfile(file_path):
290 file_path = os.path.join(entry, file_name)
291 if os.path.isfile(file_path):
331 def load_dynamic(name, path, file=None):
337 loader = importlib.machinery.ExtensionFileLoader(name, path)
342 name=name, loader=loader, origin=path)