gget r73 - trunk/gget



Author: johans
Date: Tue Aug 12 21:03:26 2008
New Revision: 73
URL: http://svn.gnome.org/viewvc/gget?rev=73&view=rev

Log:
Improve date format to be more human friendly.

Modified:
   trunk/gget/Download.py

Modified: trunk/gget/Download.py
==============================================================================
--- trunk/gget/Download.py	(original)
+++ trunk/gget/Download.py	Tue Aug 12 21:03:26 2008
@@ -53,6 +53,8 @@
                   COMPLETED:   "Completed",
                   ERROR:       "Error"}
 
+DATE_FORMAT = "%a, %d %b %Y %H:%M:%S"
+
 class Download(gobject.GObject):
     __gsignals__ = {"update": (gobject.SIGNAL_RUN_LAST, None, (int, int, int)),
                     "bitrate": (gobject.SIGNAL_RUN_LAST, None, (float,)),
@@ -101,13 +103,13 @@
             self.date_started = datetime.datetime.now()
         else:
             self.date_started = datetime.datetime.strptime(date_started,
-                    "%Y-%m-%d %H:%M:%S")
+                    DATE_FORMAT)
 
         if date_completed == "":
             self.date_completed = None
         else:
             self.date_completed = datetime.datetime.strptime(date_completed,
-                    "%Y-%m-%d %H:%M:%S")
+                    DATE_FORMAT)
 
         self.id = self.date_started.strftime("%Y%m%d%H%M%S")
 
@@ -131,10 +133,10 @@
 
     def get_date_str(self, date):
         if date == "started":
-            return self.date_started.strftime("%Y-%m-%d %H:%M:%S")
+            return self.date_started.strftime(DATE_FORMAT)
         else:
             if self.date_completed:
-                return self.date_completed.strftime("%Y-%m-%d %H:%M:%S")
+                return self.date_completed.strftime(DATE_FORMAT)
             else:
                 return ""
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]