Gerald's time-stamp format was inconsistent.
authorDiane Trout <diane@caltech.edu>
Fri, 14 Dec 2012 01:16:20 +0000 (17:16 -0800)
committerDiane Trout <diane@caltech.edu>
Fri, 14 Dec 2012 01:16:20 +0000 (17:16 -0800)
The different os / python versions had different defaults for
'%c'. I'd previously changed the read function, but not the
generation function. Also it didn't look quite like some
of my timestamps in my files.

So now both creating the time stamp and parsing the time
stamp are using the same date string.

htsworkflow/pipelines/gerald.py

index 03c7d10e4b15ad9c859387d214361b4bb88d8171..75d7d2e514485503b0cca1a612a969ddc6e156e0 100644 (file)
@@ -177,7 +177,7 @@ class CASAVA(Alignment):
         if self.tree is None:
             return
         if len(self.tree.xpath('TIME_STAMP')) == 0:
-            time_stamp = self.date.strftime('%c')
+            time_stamp = self.date.strftime("%a %b %d %H:%M:%S %Y")
             time_element = ElementTree.Element('TIME_STAMP')
             time_element.text = time_stamp
             self.tree.append(time_element)
@@ -189,7 +189,7 @@ class CASAVA(Alignment):
         if len(time_element) == 1:
            timetuple = time.strptime(
                time_element[0].text.strip(),
-               "%a %d %b %Y %I:%M:%S %p")
+               "%a %b %d %H:%M:%S %Y")
            return datetime(*timetuple[:6])
         return super(CASAVA, self)._get_date()
     date = property(_get_date)