Package gofer :: Package rmi :: Module policy :: Class Timeout
[hide private]
[frames] | no frames]

Class Timeout

source code

Policy timeout.

Instance Methods [hide private]
__init__(self, start=None, duration=None) source code
tuple(self) source code
Class Methods [hide private]
seconds(cls, tm)
Convert tm to seconds based on suffix.
source code
has_suffix(cls, tm) source code
Class Variables [hide private]
  SECOND = 1
  MINUTE = 60
Minutes in seconds.
  HOUR = 3600
Hour is seconds
  DAY = 86400
Day in seconds
  SUFFIX = {'d': 86400, 'h': 3600, 'm': 60, 's': 1}
Suffix to multiplier mapping.
Method Details [hide private]

seconds(cls, tm)
Class Method

source code 

Convert tm to seconds based on suffix.
@param tm: A timeout value.
    The string value may have a suffix of:
      (s) = seconds
      (m) = minutes
      (h) = hours
      (d) = days
@type tm: (None|int|float|str)