* src/Report.py (parse_target_frame): Remove unneeded check; when
checking existing file/dir, make sure we requested file/dir, correspondingly. * src/plugins/NavWebPage (archive_toggle): Add/remove '.tar.gz' to path when this options is turned on/off. svn: r5520
This commit is contained in:
parent
7704cd4f54
commit
c0855147df
@ -1,3 +1,10 @@
|
||||
2005-12-09 Alex Roitman <shura@gramps-project.org>
|
||||
* src/Report.py (parse_target_frame): Remove unneeded check; when
|
||||
checking existing file/dir, make sure we requested file/dir,
|
||||
correspondingly.
|
||||
* src/plugins/NavWebPage (archive_toggle): Add/remove '.tar.gz'
|
||||
to path when this options is turned on/off.
|
||||
|
||||
2005-12-08 Don Allingham <don@gramps-project.org>
|
||||
* src/Merge.py: fix date comparison
|
||||
* src/Utils.py: add xml:lang generation function
|
||||
|
@ -1412,15 +1412,10 @@ class ReportDialog(BareReportDialog):
|
||||
# First we check whether the selected path exists
|
||||
if os.path.exists(self.target_path):
|
||||
|
||||
# selected path is an existing dir
|
||||
if os.path.isdir(self.target_path):
|
||||
# check whether we asked for a dir
|
||||
if not self.get_target_is_directory():
|
||||
ErrorDialog(_("Invalid file name"),
|
||||
_("The filename that you gave is a "
|
||||
"directory.\n"
|
||||
"You need to provide a valid filename."))
|
||||
return None
|
||||
# selected path is an existing dir and we need a dir
|
||||
if os.path.isdir(self.target_path) \
|
||||
and self.get_target_is_directory():
|
||||
|
||||
# check whether the dir has rwx permissions
|
||||
if not os.access(self.target_path,os.R_OK|os.W_OK|os.X_OK):
|
||||
ErrorDialog(_('Permission problem'),
|
||||
@ -1431,8 +1426,9 @@ class ReportDialog(BareReportDialog):
|
||||
)
|
||||
return None
|
||||
|
||||
# selected path is an exsting file
|
||||
if os.path.isfile(self.target_path):
|
||||
# selected path is an exsting file and we need a file
|
||||
if os.path.isfile(self.target_path) \
|
||||
and not self.get_target_is_directory():
|
||||
a = OptionDialog(_('File already exists'),
|
||||
_('You can choose to either overwrite the '
|
||||
'file, or change the selected filename.'),
|
||||
|
@ -2639,11 +2639,23 @@ class WebReportDialog(Report.ReportDialog):
|
||||
|
||||
def archive_toggle(self,obj):
|
||||
if obj.get_active():
|
||||
# The .tar.gz box is on
|
||||
# Set doc label, mark file vs dir, add '.tar.gz' to the path
|
||||
self.target_fileentry.set_directory_entry(False)
|
||||
self.doc_label.set_label("%s:" % _("Filename"))
|
||||
fname = self.target_fileentry.get_full_path(0)
|
||||
if fname[-7:] != '.tar.gz':
|
||||
fname = fname + '.tar.gz'
|
||||
self.target_fileentry.set_filename(fname)
|
||||
else:
|
||||
# The .tar.gz box is off
|
||||
# Set doc label, mark dir vs file, remove '.tar.gz' from path
|
||||
self.target_fileentry.set_directory_entry(True)
|
||||
self.doc_label.set_label("%s:" % _("Directory"))
|
||||
fname = self.target_fileentry.get_full_path(0)
|
||||
if fname[-7:] == '.tar.gz':
|
||||
fname = fname[:-7]
|
||||
self.target_fileentry.set_filename(fname)
|
||||
|
||||
def setup_paper_frame(self):
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user