

def __fromstring__(self, timestr):
    timestr = relative.lower().strip().replace('. ', ' ')
    if (timestr in ['today', 'now', 'this week', 'this month', 'this day']):
        return currentutc()
    if (timestr in ['yesterday', 'yester day']):
        return (currentutc() - (24 * 3600))
    if (timestr in ['yesteryear', 'yester year']):
        dati = datetime.datetime.utcnow()
        return _mktime(dati.replace(year=(dati.year - 1)).timetuple())
    relative = self.__fromrelative__(timestr)
    if (relative is not None):
        return relative
    absolute = self.__fromabsolute__(timestr)
    if (absolute is not None):
        return absolute
    raise ValueError('Failed to parse time string.')

dataset/ETHPy150Open KoffeinFlummi/Chronyk/chronyk/chronyk.py Chronyk.__fromstring__/VarMisuse@14/20 `timestr`->`relative`