projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c24707
)
tahoe_backup.py: tolerate more time formats
author
Brian Warner
<warner@allmydata.com>
Fri, 13 Mar 2009 01:16:00 +0000
(18:16 -0700)
committer
Brian Warner
<warner@allmydata.com>
Fri, 13 Mar 2009 01:16:00 +0000
(18:16 -0700)
src/allmydata/scripts/tahoe_backup.py
patch
|
blob
|
history
diff --git
a/src/allmydata/scripts/tahoe_backup.py
b/src/allmydata/scripts/tahoe_backup.py
index ee9ad1204d5719a6a5bfda19e2d0358d68a17d52..b6e2644142c027129632ad9c501c9c98991216db 100644
(file)
--- a/
src/allmydata/scripts/tahoe_backup.py
+++ b/
src/allmydata/scripts/tahoe_backup.py
@@
-44,6
+44,17
@@
def parse_old_timestamp(s, options):
except ValueError:
pass
+ try:
+ # "2008-11-16 10.34.56 PM" (localtime)
+ if s[-3:] in (" AM", " PM"):
+ # this might raise ValueError
+ when = time.strptime(s[:-3], "%Y-%m-%d %I.%M.%S")
+ if s[-3:] == "PM":
+ when += 12*60*60
+ return when
+ except ValueError:
+ pass
+
try:
# "2008-12-31 18.21.43"
when = time.strptime(s, "%Y-%m-%d %H.%M.%S")