Lines Matching refs:path

27 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
37 os.path.abspath(
38 os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
62 if os.path.exists(dir_path):
66 def touch(path, fail_if_missing=False):
67 if fail_if_missing and not os.path.exists(path):
68 raise Exception(path + ' doesn\'t exist.')
70 make_directory(os.path.dirname(path))
71 with open(path, 'a'):
72 os.utime(path, None)
79 files.extend((os.path.join(root, f) for f in matched_files))
83 def read_build_vars(path):
85 with open(path) as f:
124 def write_json(obj, path, only_if_changed=False):
126 if os.path.exists(path):
127 with open(path, 'r') as oldfile:
136 with open(path, 'w') as outfile:
141 def atomic_output(path, only_if_changed=True):
145 path: Path to the final output file, which will be written atomically.
159 with tempfile.NamedTemporaryFile(suffix=os.path.basename(path),
160 dir=os.path.dirname(path),
169 if not (only_if_changed and os.path.exists(path)
170 and filecmp.cmp(f.name, path)):
171 shutil.move(f.name, path)
173 if os.path.exists(f.name):
194 os.path.abspath(self.cwd), ' '.join(map(pipes.quote, self.args)))
272 def get_modified_time(path):
275 return max(os.lstat(path).st_mtime, os.stat(path).st_mtime)
279 if not os.path.exists(output):
290 if os.path.normpath(name) != name:
291 raise Exception('Non-canonical zip path: %s' % name)
292 if os.path.isabs(name):
293 raise Exception('Absolute zip path: %s' % name)
305 path=None,
309 if path is None:
310 path = os.getcwd()
311 elif not os.path.exists(path):
312 make_directory(path)
321 make_directory(os.path.join(path, name))
330 output_path = os.path.join(path, name)
331 if os.path.exists(output_path):
335 dest = os.path.join(path, name)
336 make_directory(os.path.dirname(dest))
340 z.extract(name, path)
341 extracted.append(os.path.join(path, name))
356 zip_path: Destination path within the zip file.
368 if src_path and os.path.islink(src_path):
414 zip_prefix_path: Path prepended to file path in zip file.
419 tup = (os.path.relpath(tup, base_dir), tup)
422 # Sort by zip path to ensure stable zip ordering.
427 zip_path = os.path.join(zip_prefix_path, zip_path)
440 inputs.append(os.path.join(root, f))
450 def matches_glob(path, filters):
451 """Returns whether the given path matches any of the given glob patterns."""
452 return filters and any(fnmatch.fnmatch(path, f) for f in filters)
474 path_transform: Called for each entry path. Returns a new path, or None to
558 A path is assumed to be a "system" import if it is outside of chromium's
564 abs_module_paths = list(map(os.path.abspath, module_paths))
566 assert os.path.isabs(DIR_SOURCE_ROOT)
579 map(os.path.relpath, non_system_module_paths))
614 make_directory(os.path.dirname(depfile_path))
740 last path entry of |base|.
744 result.extend([os.path.join(root, f) for f in files])
751 return os.path.relpath(os.path.join(current_base, path_to_rebase), new_base)
753 return os.path.realpath(os.path.join(current_base, path_to_rebase))