[hamster-applet/gnome-2-28] fixed bug 596638 with help from Marco Villegas - appending file extension to reports based on format
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet/gnome-2-28] fixed bug 596638 with help from Marco Villegas - appending file extension to reports based on format
- Date: Tue, 17 Nov 2009 09:23:48 +0000 (UTC)
commit a07e8bc4ffca8db51b78aacae61abb25c6366254
Author: Toms Bauģis <toms baugis gmail com>
Date: Tue Nov 17 09:07:38 2009 +0000
fixed bug 596638 with help from Marco Villegas - appending file extension to reports based on format
hamster/stats.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/hamster/stats.py b/hamster/stats.py
index 83bf1e1..55b84be 100644
--- a/hamster/stats.py
+++ b/hamster/stats.py
@@ -109,7 +109,7 @@ class ReportChooserDialog(gtk.Dialog):
def show(self, start_date, end_date):
#set suggested name to something readable, replace backslashes with dots
#so the name is valid in linux
- filename = "Time track %s - %s" % (start_date.strftime("%x").replace("/", "."),
+ filename = "Time track %s - %s." % (start_date.strftime("%x").replace("/", "."),
end_date.strftime("%x").replace("/", "."))
self.dialog.set_current_name(filename)
@@ -157,6 +157,12 @@ class ReportChooserDialog(gtk.Dialog):
format = self.filters[self.dialog.get_filter()]
path = self.dialog.get_filename()
+ # append correct extension if it is missing
+ # TODO - proper way would be to change extension on filter change
+ # only pointer in web is http://www.mail-archive.com/pygtk daa com au/msg08740.html
+ if path.endswith(".%s" % format) == False:
+ path = "%s.%s" % (path.rstrip("."), format)
+
categories = []
for button in self.category_box.get_children():
if button.get_active():
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]