|
2 | 2 |
|
3 | 3 | # /************************************************************************** |
4 | 4 | # |
5 | | -# Copyright (c) 2005-13 Simon Peter |
| 5 | +# Copyright (c) 2005-15 Simon Peter |
6 | 6 | # |
7 | 7 | # All Rights Reserved. |
8 | 8 | # |
@@ -46,51 +46,31 @@ import xdgappdir |
46 | 46 | import commands |
47 | 47 | import threading |
48 | 48 | import glob |
49 | | -import colors |
| 49 | + |
50 | 50 |
|
51 | 51 | def usage(): |
52 | 52 | print "Usage:" |
53 | | - print " ", colors.BOLD, "--pack, --package", colors.END, "<input AppDir>", "<output AppImage>" |
54 | | - print " "*6, "Create an AppImage from an AppDir" |
55 | | - print " ", colors.BOLD, "--unpack, --extract", colors.END, "<input AppImage>", "<output AppDir>", "[<path inside AppImage>]" |
56 | | - print " "*6, "Extract an AppImage to an AppDir" |
57 | | - print " ", colors.BOLD, "-h, --help", colors.END |
58 | | - print " "*6, "Show this help message" |
59 | | - print " ", colors.BOLD, "<no arguments>", colors.END |
60 | | - print " "*6, "Start AppImage creation wizard" |
| 53 | + print " ", "<input AppDir>", "<output AppImage>" |
| 54 | + print " ", "Create an AppImage from an AppDir" |
| 55 | + print " ", "-f, --force" |
| 56 | + print " ", "Overwrite target if already existing" |
| 57 | + print " ", "-h, --help" |
| 58 | + print " ", "Show this help message" |
| 59 | + print " ", "<no arguments>" |
| 60 | + print " ", "Start AppImage creation wizard" |
| 61 | + exit(0) |
| 62 | + |
| 63 | + |
| 64 | +if len(sys.argv) == 2: |
| 65 | + usage() |
61 | 66 |
|
62 | 67 | for arg in sys.argv: |
63 | | - if arg in ["--pack", "--package"]: |
64 | | - if len(sys.argv) < 4: |
65 | | - usage() |
66 | | - elif not os.path.exists(sys.argv[2]): |
67 | | - print sys.argv[2], "doesn't exist" |
68 | | - elif not os.path.isdir(sys.argv[2]): |
69 | | - print sys.argv[2], "is not a directory" |
70 | | - elif os.path.exists(sys.argv[3]): |
71 | | - print sys.argv[3], "already exists" |
72 | | - else: |
73 | | - os.system(os.path.dirname(__file__) + "/package '%s' '%s'" % (sys.argv[2], sys.argv[3])) |
74 | | - exit(0) |
75 | | - elif arg in ["--unpack", "--extract"]: |
76 | | - if len(sys.argv) < 4: |
77 | | - usage() |
78 | | - elif not os.path.exists(sys.argv[2]): |
79 | | - print sys.argv[2], "doesn't exist" |
80 | | - elif not os.path.isfile(sys.argv[2]): |
81 | | - print sys.argv[2], "is not a file" |
82 | | - elif os.path.exists(sys.argv[3]): |
83 | | - print sys.argv[3], "already exists" |
84 | | - else: |
85 | | - origin = "/" |
86 | | - if len(sys.argv) >= 5: |
87 | | - origin = sys.argv[4] |
88 | | - os.system(os.path.dirname(__file__) + "/extract '%s' '%s' '%s'" % (sys.argv[2], sys.argv[3], origin)) |
89 | | - exit(0) |
90 | | - elif arg in ["-h", "--help"]: |
| 68 | + if arg in ["-h", "--help"]: |
91 | 69 | usage() |
92 | | - exit(0) |
93 | 70 |
|
| 71 | +if len(sys.argv) == (3): |
| 72 | + os.system(os.path.dirname(__file__) + "/package %s %s" % (sys.argv[1], sys.argv[2])) |
| 73 | + exit(0) |
94 | 74 |
|
95 | 75 | import gtk, vte |
96 | 76 | import xdgappdir # bundled with this app |
@@ -164,8 +144,6 @@ class Assistant(gtk.Assistant): |
164 | 144 | self.set_size_request(640, 480) |
165 | 145 | self.init_intro_page() |
166 | 146 |
|
167 | | - |
168 | | - |
169 | 147 | def text_page(self, header, text): |
170 | 148 | label = gtk.Label(text) |
171 | 149 | label.show() |
@@ -304,7 +282,6 @@ class RunBox(vte.Terminal): |
304 | 282 | self.connect('child-exited', self.run_command_done_callback) |
305 | 283 | self.assistant = assistant # the assistant is passed in here so that we can e.g., disable forward buttons |
306 | 284 |
|
307 | | - |
308 | 285 | def run_command(self, command_list): |
309 | 286 | self.assistant.set_page_complete(self.assistant.get_nth_page(self.assistant.get_current_page()), False) |
310 | 287 | self.thread_running = True |
|
0 commit comments