Lines Matching refs:f

76     def f(t: ModuleType, _: ModuleName) -> bool:  function
79 return f
83 def f(_: ModuleType, n: ModuleName) -> bool: function
86 return f
98 return f"{module_def[: index]}-${{suffix}}{module_def[index:]}"
102 src_lines: TextIO, f: Filter
119 f"{module_name} already exists thus " f"ignoring {module_type}"
122 if not f(module_type, module_name):
125 module_def = f"{module_def[: i]}-${{suffix}}{module_def[i:]}"
180 f"{_back_up_path()} already exists. "
181 f"Did you kill a previous cuj run? "
182 f"Delete {_back_up_path()} and revert changes to "
183 f"allowlists.go and Android.bp files"
217 r = f"{str(uuid.uuid4()):.6}" # cache-busting
221 with open(src(_ALLOWLISTS), "rt") as f:
222 go_allowlists = GoAllowlistManipulator(f.readlines())
237 f"{n:5,}X{len(n2t):2,} modules = {n * len(n2t):+5,} "
238 f"in {bp.relative_to(util.get_top_dir())}"
240 with open(bp, "a") as f:
244 suffix = f"{r}-{n:05d}"
245 f.write(t.substitute(suffix=suffix))
246 clones.append(ModuleName(f"{name}-{suffix}"))
249 with open(src(_ALLOWLISTS), "wt") as f:
250 f.writelines(go_allowlists.lines)
253 f"Cloned {n:,}X{source_count:,} modules = {n * source_count:+,} "
254 f"in {len(bp2templates)} Android.bp files"
275 f"{orig_size:7,} {curr_size - orig_size :+5,} => {curr_size:9,} "
276 f"bytes {source_file.relative_to(util.get_top_dir())}"
281 f"{os.stat(bz).st_size:8,} bytes "
282 f"$OUTDIR/{bz.relative_to(util.get_out_dir())}"
285 f"Affected {file_count} files {orig_tot:,} "
286 f"{curr_tot - orig_tot:+,} => {curr_tot:,} bytes"
294 name = f"{count}"
296 name = f"{count}x{module_count}"
298 name = f"{name}({bp_count} files)"
311 raise RuntimeError(f"No eligible module to clone in {self.bps.keys()}")
319 f'Will clone {",".join(str(i) for i in counts)} in cujs. '
320 f"You may specify alternative counts with CLONE env var, "
321 f"e.g. CLONE = 1,10,100,1000"
326 with open(first_bp, mode="a") as f:
327 f.write(f"//post clone modification {uuid.uuid4()}\n")
344 steps.append(cuj.CujStep(verb=f"bp aft {base_name}", apply_change=modify_bp))