Beispiel #1
0
def merge_playtimes(app_list):
    playtime = {}
    for app in app_list:
        for d, m in zip(app.date, app.playtime):
            playtime[d] = playtime[d] + m if d in playtime else m
    return [(utils.unix2datetime(d), playtime[d]) for d in playtime]
Beispiel #2
0
 def get_dt_to(self):
     return utils.unix2datetime(self.unix_timestamp_to)
Beispiel #3
0
 def set_to(self, timestamp):
     dt_to = utils.unix2datetime(timestamp)
     self.unix_timestamp_to = utils.datetime2unix(dt_to + \
             timedelta(hours=24 - dt_to.hour))
Beispiel #4
0
 def get_dt_from(self):
     return utils.unix2datetime(self.unix_timestamp_from)
Beispiel #5
0
 def set_from(self, timestamp):
     dt_from = utils.unix2datetime(timestamp)
     self.unix_timestamp_from = utils.datetime2unix(dt_from - \
             timedelta(hours=dt_from.hour))