main.py, pysource.py DRY deparse_code from main. Is better on showing

exception errrors such as when a pyc file is not found
uncompyle6: Hook in --grammar option to showing grammar.
rules. Default now does not show timestamp.
This commit is contained in:
rocky
2015-12-22 05:15:00 -05:00
parent 4f0fe90eef
commit 217b1b6f54
6 changed files with 53 additions and 70 deletions

View File

@@ -24,7 +24,7 @@ Options:
uncompyle6 -o /tmp /usr/lib/python1.5
-> /tmp/smtplib.pyc_dis ... /tmp/lib-tk/FixTk.pyc_dis
-c <file> attempts a disassembly after compiling <file>
-d do not print timestamps
-d print timestamps
-p <integer> use <integer> number of processes
-r recurse directories looking for .pyc and .pyo files
--verify compare generated source with input byte-code
@@ -64,7 +64,7 @@ numproc = 0
outfile = '-'
out_base = None
codes = []
timestamp = True
timestamp = False
timestampfmt = "# %Y.%m.%d %H:%M:%S %Z"
try:
@@ -93,7 +93,7 @@ for opt, val in opts:
elif opt == '-o':
outfile = val
elif opt == ('--timestamp', '-d'):
timestamp = False
timestamp = True
elif opt == '-c':
codes.append(val)
elif opt == '-p':
@@ -140,6 +140,7 @@ elif outfile and len(files) > 1:
if timestamp:
print(time.strftime(timestampfmt))
if numproc <= 1:
try:
result = main(src_base, out_base, files, codes, outfile,