gget r87 - trunk/gget
- From: johans svn gnome org
- To: svn-commits-list gnome org
- Subject: gget r87 - trunk/gget
- Date: Sun, 17 Aug 2008 00:28:40 +0000 (UTC)
Author: johans
Date: Sun Aug 17 00:28:40 2008
New Revision: 87
URL: http://svn.gnome.org/viewvc/gget?rev=87&view=rev
Log:
Bugfix.
Modified:
trunk/gget/ (props changed)
trunk/gget/Download.py
trunk/gget/DownloadList.py
Modified: trunk/gget/Download.py
==============================================================================
--- trunk/gget/Download.py (original)
+++ trunk/gget/Download.py Sun Aug 17 00:28:40 2008
@@ -53,7 +53,8 @@
COMPLETED: "Completed",
ERROR: "Error"}
-DATE_FORMAT = "%a, %d %b %Y %H:%M:%S"
+DATE_FORMAT_HUMAN = "%a, %d %b %Y %H:%M:%S"
+DATE_FORMAT_DIGIT = "%Y-%m-%d %H:%M:%S"
class Download(gobject.GObject):
__gsignals__ = {"update": (gobject.SIGNAL_RUN_LAST, None, (int, int, int)),
@@ -103,13 +104,13 @@
self.date_started = datetime.datetime.now()
else:
self.date_started = datetime.datetime.strptime(date_started,
- DATE_FORMAT)
+ DATE_FORMAT_DIGIT)
if date_completed == "":
self.date_completed = None
else:
self.date_completed = datetime.datetime.strptime(date_completed,
- DATE_FORMAT)
+ DATE_FORMAT_DIGIT)
self.id = self.date_started.strftime("%Y%m%d%H%M%S")
@@ -131,12 +132,12 @@
except:
return 0
- def get_date_str(self, date):
+ def get_date_str(self, date, format=DATE_FORMAT_HUMAN):
if date == "started":
- return self.date_started.strftime(DATE_FORMAT)
+ return self.date_started.strftime(format)
else:
if self.date_completed:
- return self.date_completed.strftime(DATE_FORMAT)
+ return self.date_completed.strftime(format)
else:
return ""
Modified: trunk/gget/DownloadList.py
==============================================================================
--- trunk/gget/DownloadList.py (original)
+++ trunk/gget/DownloadList.py Sun Aug 17 00:28:40 2008
@@ -124,10 +124,12 @@
status_element = ET.SubElement(download_element, "status")
status_element.text = str(download.status)
date_started_element = ET.SubElement(download_element, "date_started")
- date_started_element.text = download.get_date_str("started")
+ date_started_element.text = download.get_date_str("started",
+ Download.DATE_FORMAT_DIGIT)
date_completed_element = ET.SubElement(download_element,
- "date_completed")
- date_completed_element.text = download.get_date_str("completed")
+ "date_completed")
+ date_completed_element.text = download.get_date_str("completed",
+ Download.DATE_FORMAT_DIGIT)
self.__save_xml()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]