Create the directory if it doesn't exist for the web calendar.

svn: r9190
This commit is contained in:
Brian Matherly 2007-10-15 12:26:31 +00:00
parent c42bfa3caf
commit 8aaf924411
2 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2007-10-15 Brian Matherly <brian@gramps-project.org>
* src/plugins/WebCal.py: Create directory if it doesn't exist.
2007-10-14 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsBSDDB.py: fix gen calls

View File

@ -446,6 +446,24 @@ class WebReport(Report):
def write_report(self):
""" The short method that runs through each month and creates a page. """
if not os.path.isdir(self.html_dir):
parent_dir = os.path.dirname(self.html_dir)
if not os.path.isdir(parent_dir):
ErrorDialog(_("Neither %s nor %s are directories") % \
(self.html_dir,parent_dir))
return
else:
try:
os.mkdir(self.html_dir)
except IOError, value:
ErrorDialog(_("Could not create the directory: %s") % \
self.html_dir + "\n" + value[1])
return
except:
ErrorDialog(_("Could not create the directory: %s") % \
self.html_dir)
return
# initialize the dict to fill:
self.calendar = {}
self.progress = Utils.ProgressMeter(_("Generate HTML calendars"),'')