MCPcopy Index your code
hub / github.com/python/cpython / main

Function main

Tools/patchcheck/reindent.py:69–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67 sys.stderr.write("\n")
68
69def main():
70 import getopt
71 global verbose, recurse, dryrun, makebackup, spec_newline
72 try:
73 opts, args = getopt.getopt(sys.argv[1:], "drnvh",
74 ["dryrun", "recurse", "nobackup", "verbose", "newline=", "help"])
75 except getopt.error as msg:
76 usage(msg)
77 return
78 for o, a in opts:
79 if o in ('-d', '--dryrun'):
80 dryrun = True
81 elif o in ('-r', '--recurse'):
82 recurse = True
83 elif o in ('-n', '--nobackup'):
84 makebackup = False
85 elif o in ('-v', '--verbose'):
86 verbose = True
87 elif o in ('--newline',):
88 if not a.upper() in ('CRLF', 'LF'):
89 usage()
90 return
91 spec_newline = dict(CRLF='\r\n', LF='\n')[a.upper()]
92 elif o in ('-h', '--help'):
93 usage()
94 return
95 if not args:
96 r = Reindenter(sys.stdin)
97 r.run()
98 r.write(sys.stdout)
99 return
100 for arg in args:
101 check(arg)
102
103
104def check(file):

Callers 1

reindent.pyFile · 0.70

Calls 6

runMethod · 0.95
writeMethod · 0.95
ReindenterClass · 0.85
usageFunction · 0.70
checkFunction · 0.70
upperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…