4 import sys
, os
, formats
7 from rox
import g
, TRUE
, FALSE
, saving
10 rox
.info("Drag a file or directory onto Archive to archive it. "
11 "Drag an archive onto it to extract.")
14 from support
import escape
, Tmp
, pipe_through_command
16 from box
import ArchiveBox
18 # Check that our input is a regular local file.
19 # If not, fetch the data and put it in /tmp.
24 path
= rox
.get_local_path(path
)
26 rox
.croak('Sorry, I can only extract/archive local files.')
27 path
= os
.path
.abspath(path
)
29 # Show the savebox, so at least the user knows something is happening..
31 savebox
= ArchiveBox()
35 if os
.path
.isdir(path
):
36 data
= formats
.DirData(path
)
38 data
= formats
.FileData(path
)
39 savebox
.set_data(data
)