2007-06-30 Alex Roitman <shura@gramps-project.org>
* src/ReportBase/_TemplateParser.py: Close file after parsing. * src/ReportBase/_ReportOptions.py (OptionListCollection.parse): Close file after parsing. * src/ReportBase/_PaperMenu.py: Close file after parsing. * src/plugins/BookReport.py (BookList.parse): Close file after parsing. * src/Filters/_FilterList.py (load): Close file after parsing. * src/BaseDoc.py (StyleSheetList.parse): Close file after parsing. svn: r8687
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-2007 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
|
||||
@@ -175,7 +175,9 @@ class PageSizeParser(handler.ContentHandler):
|
||||
try:
|
||||
parser = make_parser()
|
||||
parser.setContentHandler(PageSizeParser(paper_sizes))
|
||||
parser.parse(const.papersize)
|
||||
the_file = open(const.papersize)
|
||||
parser.parse(the_file)
|
||||
the_file.close()
|
||||
paper_sizes.append(BaseDoc.PaperSize(_("Custom Size"),-1,-1))
|
||||
except (IOError,OSError,SAXParseException):
|
||||
paper_sizes = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2004-2006 Donald N. Allingham
|
||||
# Copyright (C) 2004-2007 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
|
||||
@@ -280,7 +280,9 @@ class OptionListCollection(_Options.OptionListCollection):
|
||||
if os.path.isfile(self.filename):
|
||||
p = make_parser()
|
||||
p.setContentHandler(OptionParser(self))
|
||||
p.parse(self.filename)
|
||||
the_file = open(self.filename)
|
||||
p.parse(the_file)
|
||||
the_file.close()
|
||||
except (IOError,OSError,SAXParseException):
|
||||
pass
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2001-2006 Donald N. Allingham
|
||||
# Copyright (C) 2001-2007 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
|
||||
@@ -98,7 +98,9 @@ try:
|
||||
if os.path.isfile(xmlfile):
|
||||
parser = make_parser()
|
||||
parser.setContentHandler(TemplateParser(_template_map,template_path))
|
||||
parser.parse(xmlfile)
|
||||
the_file = open(xmlfile)
|
||||
parser.parse(the_file)
|
||||
the_file.close()
|
||||
|
||||
template_path = os.path.join(const.home_dir,"templates")
|
||||
xmlfile = os.path.join(template_path,"templates.xml")
|
||||
|
||||
Reference in New Issue
Block a user