New release.
[rox-archive.git] / AppRun
blobc3d1b1f9f7576886cb9e2fe7f1788b135d624361
1 #!/usr/bin/env python
3 import findrox; findrox.version(1, 9, 6)
4 import sys, os, formats
6 import rox
7 from rox import g, TRUE, FALSE, saving
8 __builtins__._ = rox.i18n.translation(os.path.join(rox.app_dir, 'Messages'))
10 if len(sys.argv) != 2:
11 rox.info(_("Drag a file or directory onto Archive to archive it. "
12 "Drag an archive onto it to extract."))
13 sys.exit(0)
15 from box import ArchiveBox
17 path = sys.argv[1]
19 if path != '-':
20 path = rox.get_local_path(path)
21 if not path:
22 rox.croak(_('Sorry, I can only extract/archive local files.'))
23 path = os.path.abspath(path)
25 # Show the savebox, so at least the user knows something is happening...
27 savebox = ArchiveBox()
28 savebox.show()
29 g.gdk.flush()
31 if os.path.isdir(path):
32 data = formats.DirData(path)
33 else:
34 data = formats.FileData(path)
35 savebox.set_data(data)
37 rox.mainloop()