* 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:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2005 Donald N. Allingham
|
||||
# Copyright (C) 2000-2006 Donald N. Allingham
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -37,7 +37,7 @@ from gettext import gettext as _
|
||||
#------------------------------------------------------------------------
|
||||
import PluginMgr
|
||||
import ImgManip
|
||||
import TarFile
|
||||
import tarfile
|
||||
import const
|
||||
import Errors
|
||||
import BaseDoc
|
||||
@@ -148,8 +148,10 @@ class HtmlDoc(BaseDoc.BaseDoc):
|
||||
stop = re.compile(r"<!--\s*STOP\s*-->")
|
||||
top_add = 1
|
||||
bottom_add = 0
|
||||
tf = TarFile.ReadTarFile(self.template,None)
|
||||
self.map = tf.extract_files()
|
||||
archive = tarfile.open(self.template)
|
||||
for tarinfo in archive:
|
||||
self.map[tarinfo.name] = archive.extractfile(tarinfo)
|
||||
archive.close()
|
||||
templateFile = self.map['template.html']
|
||||
while 1:
|
||||
line = templateFile.readline()
|
||||
|
Reference in New Issue
Block a user