MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / main

Function main

scripts/website/americanize_spelling.py:181–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179
180
181def main():
182 ap = argparse.ArgumentParser(description=__doc__)
183 ap.add_argument("paths", nargs="+")
184 ap.add_argument("--write", action="store_true", help="Apply (default: dry run)")
185 args = ap.parse_args()
186 import collections
187 counts = collections.Counter()
188 changed, skipped = [], []
189 for path in expand(args.paths):
190 if process_file(path, args.write, counts, skipped):
191 changed.append(os.path.basename(path))
192 mode = "WROTE" if args.write else "DRY RUN — would change"
193 print(f"{mode} {len(changed)} post(s); skipped {len(skipped)} Steve-Hannah post(s).")
194 print(f"Total substitutions: {sum(counts.values())}")
195 for k, n in counts.most_common():
196 print(f" {n:4d} {k}")
197 return 0
198
199
200if __name__ == "__main__":

Callers 1

Calls 5

expandFunction · 0.85
CounterMethod · 0.80
process_fileFunction · 0.70
appendMethod · 0.65
valuesMethod · 0.65

Tested by

no test coverage detected