Skip to content

Commit a24d1c6

Browse files
author
Ralph Moritz
committed
Minor script cleanup.
Fix inconsistencies in uncompyle2 script, rename to scripts/uncompyle2 & add to setup.py (these are all changes from wibiti). Also, change script headers so they work on Windows too. Remove build folder from repo & add .gitignore so it doesn't inadvertently get added again.
1 parent f14ff1b commit a24d1c6

6 files changed

Lines changed: 21 additions & 205 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+
build
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
#!/usr/bin/python2.7
1+
#! python
22
# Mode: -*- python -*-
33
#
44
# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
55
#
6-
"""
7-
Usage: uncompyle [OPTIONS]... [ FILE | DIR]...
6+
'''
7+
Usage: uncompyle2 [OPTIONS]... [ FILE | DIR]...
88
99
Examples:
10-
uncompyle foo.pyc bar.pyc # uncompyle foo.pyc, bar.pyc to stdout
11-
uncompyle -o . foo.pyc bar.pyc # uncompyle to ./foo.dis and ./bar.dis
12-
uncompyle -o /tmp /usr/lib/python1.5 # uncompyle whole library
10+
uncompyle2 foo.pyc bar.pyc # decompile foo.pyc, bar.pyc to stdout
11+
uncompyle2 -o . foo.pyc bar.pyc # decompile to ./foo.pyc_dis and ./bar.pyc_dis
12+
uncompyle2 -o /tmp /usr/lib/python1.5 # decompile whole library
1313
1414
Options:
1515
-o <path> output decompiled files to this path:
1616
if multiple input files are decompiled, the common prefix
1717
is stripped from these names and the remainder appended to
1818
<path>
1919
uncompyle -o /tmp bla/fasel.pyc bla/foo.pyc
20-
-> /tmp/fasel.dis, /tmp/foo.dis
20+
-> /tmp/fasel.pyc_dis, /tmp/foo.pyc_dis
2121
uncompyle -o /tmp bla/fasel.pyc bar/foo.pyc
22-
-> /tmp/bla/fasel.dis, /tmp/bar/foo.dis
22+
-> /tmp/bla/fasel.pyc_dis, /tmp/bar/foo.pyc_dis
2323
uncompyle -o /tmp /usr/lib/python1.5
24-
-> /tmp/smtplib.dis ... /tmp/lib-tk/FixTk.dis
24+
-> /tmp/smtplib.pyc_dis ... /tmp/lib-tk/FixTk.pyc_dis
2525
-c <file> attempts a disassembly after compiling <file>
2626
-d do not print timestamps
2727
-p <integer> use <integer> number of processes
@@ -35,13 +35,13 @@ Debugging Options:
3535
--showast -t include AST (abstract syntax tree) (disables --verify)
3636
3737
Extensions of generated files:
38-
'.dis' successfully decompiled (and verified if --verify)
39-
'.dis_unverified' successfully decompile but --verify failed
40-
'.nodis' uncompyle failed (contact author for enhancement)
41-
"""
38+
'.pyc_dis' '.pyo_dis' successfully decompiled (and verified if --verify)
39+
+ '_unverified' successfully decompile but --verify failed
40+
+ '_failed' decompile failed (contact author for enhancement)
41+
'''
4242

4343
Usage_short = \
44-
"decomyple [--help] [--verify] [--showasm] [--showast] [-o <path>] FILE|DIR..."
44+
"uncompyle2 [--help] [--verify] [--showasm] [--showast] [-o <path>] FILE|DIR..."
4545

4646
import sys, os, getopt
4747
import os.path

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#! python
22

33
"""Setup script for the 'uncompyle' distribution."""
44

@@ -10,5 +10,6 @@
1010
author = "Mysterie",
1111
author_email = "kajusska@gmail.com",
1212
url = "http://github.com/Mysterie/uncompyle2",
13-
packages=['uncompyle2', 'uncompyle2.opcode']
13+
packages=['uncompyle2', 'uncompyle2.opcode'],
14+
scripts=['scripts/uncompyle2']
1415
)

test/compile_tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2.5
1+
#! python
22
"""
33
compile_tests -- compile test patterns for the decompyle test suite
44
"""

test_pythonlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2.7
1+
#! python
22

33
'''
44
test_pythonlib -- uncompyle and verify Python libraries

uncompyle2.py

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)