Esempio n. 1
0
File: time.py Progetto: sattel/pygal
def timedelta_to_seconds(x):
    """Convert a timedelta into an amount of seconds"""
    if isinstance(x, timedelta):
        return total_seconds(x)
    return x
Esempio n. 2
0
 def _tonumber(self, d):
     """ Converts a date to a number """
     if d is None:
         return None
     return total_seconds(d - self._offset)
Esempio n. 3
0
def timedelta_to_seconds(x):
    if isinstance(x, timedelta):
        return total_seconds(x)
    return x