def get_future_events (): t = time.gmtime(time.time()) # c = calendar.timegm( (t[0], t[1], t[2], 0, 0, 0, 0, 1, -1) ) c = get_int_from_YMD(t[0], t[1], t[2]) all = get_all_events() f = [] for e in all: bn = os.path.basename(e) if int(bn) >= c: f.append(e) f.sort() return f
def is_date_valid (event_id): t = time.gmtime(time.time()) # c = calendar.timegm( (t[0], t[1], t[2], 0, 0, 0, 0, 1, -1) ) c = get_int_from_YMD(t[0], t[1], t[2]) return int(event_id) >= c
def create_event_id (y, m, d): # id_int = calendar.timegm((int(y), int(m), int(d), 0, 0, 0, 0, 1, -1)) id_int = get_int_from_YMD(y, m, d) while os.path.exists(os.path.join(EVENTDIR, str(id_int))): id_int += 1 return str(id_int)