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