pvl.login.PubTkt: grace_period() for the fixed length of the grace period
authorTero Marttila <terom@paivola.fi>
Mon, 13 Jan 2014 20:25:03 +0200
changeset 366 af3833864b89
parent 365 e9e3d1580d36
child 367 e431a1b71006
pvl.login.PubTkt: grace_period() for the fixed length of the grace period
pvl/login/pubtkt.py
--- a/pvl/login/pubtkt.py	Mon Jan 13 19:42:27 2014 +0200
+++ b/pvl/login/pubtkt.py	Mon Jan 13 20:25:03 2014 +0200
@@ -259,6 +259,16 @@
             # expired
             return False
 
+    def grace_period (self) :
+        """
+            Return the length of the grace period.
+        """
+
+        if self.graceperiod :
+            return self.validuntil - self.graceperiod
+        else :
+            return None
+    
     def renew (self, valid, grace=None) :
         if not self.valid() :
             raise ExpiredError(self, "Unable to renew expired pubtkt")