aboutsummaryrefslogtreecommitdiff
path: root/scripts/rpki/sundial.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2008-02-27 00:33:38 +0000
committerRob Austein <sra@hactrn.net>2008-02-27 00:33:38 +0000
commit62e55cba4e0567b6808bc527420560e7f3f9d551 (patch)
tree9b14379a697fd83cce1022e6b1860c996f8e480e /scripts/rpki/sundial.py
parent61133f08722018534d07527ffedc19ee5e0ced20 (diff)
Implement up-down <class resource_set_notafter="..."/> attribute, and
fix XML namespace handling to keep new version of lxml happy. svn path=/scripts/README; revision=1529
Diffstat (limited to 'scripts/rpki/sundial.py')
-rw-r--r--scripts/rpki/sundial.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/rpki/sundial.py b/scripts/rpki/sundial.py
index 0703ff22..a1ffde62 100644
--- a/scripts/rpki/sundial.py
+++ b/scripts/rpki/sundial.py
@@ -75,12 +75,18 @@ class datetime(pydatetime.datetime):
@classmethod
def fromXMLtime(cls, x):
"""Convert from XML time representation."""
- return cls.strptime(x, "%Y-%m-%dT%H:%M:%SZ")
+ if x is None:
+ return None
+ else:
+ return cls.strptime(x, "%Y-%m-%dT%H:%M:%SZ")
def toXMLtime(self):
"""Convert to XML time representation."""
return self.strftime("%Y-%m-%dT%H:%M:%SZ")
+ def __str__(self):
+ return self.toXMLtime()
+
@classmethod
def fromdatetime(cls, x):
"""Convert a datetime.datetime object into this subclass.