* src/ViewManager.py (ViewManager.import_data): Properly process
non-native (plugin) imports; (_do_import): factor common code into the new method. * src/GrampsDb/_ReadXML.py (GrampsParser.__init__): Skip updating if callback is empty (non-callable). * src/docgen/HtmlDoc.py (HtmlDoc.load_tpkg): Use tarfile. * src/ArgHandler.py (ArgHandler.cl_import): Use tarfile. * src/plugins/WritePkg.py (PackageWriter.export): Use tarfile. * src/plugins/ReadPkg.py (impData): Use tarfile module. svn: r6012
This commit is contained in:
@@ -456,12 +456,19 @@ class ArgHandler:
|
||||
os.remove( os.path.join(tmpdir_path,fn) )
|
||||
|
||||
try:
|
||||
import TarFile
|
||||
t = TarFile.ReadTarFile(filename,tmpdir_path)
|
||||
t.extract()
|
||||
t.close()
|
||||
import tarfile
|
||||
archive = tarfile.open(filename)
|
||||
for tarinfo in archive:
|
||||
archive.extract(tarinfo,tmpdir_path)
|
||||
archive.close()
|
||||
except ReadError, msg:
|
||||
print "Error reading archive:", msg
|
||||
os._exit(1)
|
||||
except CompressError, msg:
|
||||
print "Error uncompressing archive:", msg
|
||||
os._exit(1)
|
||||
except:
|
||||
print "Error extracting into %s" % tmpdir_path
|
||||
print "Error extracting into %s" % tmpdir_path
|
||||
os._exit(1)
|
||||
|
||||
dbname = os.path.join(tmpdir_path,const.xmlFile)
|
||||
|
Reference in New Issue
Block a user