diff --git a/ChangeLog b/ChangeLog index c81408b81..f83832ce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2008-01-15 Benny Malengier + * src/GrampsDbUtils/_GrampsDbWriteXML.py: import gzip + 2008-01-15 Douglas S. Blank * src/plugins/SameSurnames.py (IncompleteSurname.apply): can bring up people with empty surname diff --git a/src/GrampsDbUtils/_GrampsDbWriteXML.py b/src/GrampsDbUtils/_GrampsDbWriteXML.py index 2920d2e22..967c017cd 100644 --- a/src/GrampsDbUtils/_GrampsDbWriteXML.py +++ b/src/GrampsDbUtils/_GrampsDbWriteXML.py @@ -103,6 +103,11 @@ class GrampsDbXmlWriter(UpdateCallback): """ UpdateCallback.__init__(self, callback) self.compress = compress + if self.compress: + try: + import gzip + except: + self.compress = False self.db = db self.strip_photos = strip_photos self.version = version @@ -137,6 +142,7 @@ class GrampsDbXmlWriter(UpdateCallback): self.fileroot = os.path.dirname(filename) try: if self.compress: + import gzip try: g = gzip.open(filename,"wb") except: @@ -161,6 +167,7 @@ class GrampsDbXmlWriter(UpdateCallback): """ if self.compress: + import gzip try: g = gzip.GzipFile(mode="wb",fileobj=handle) except: