def sum_history(wechat_id): subprocess.call("clear") while True: obj = ManCheckin(wechat_id) if obj.tea_id == 0: print PrtInfo.failedMessage(4) prompt = raw_input('maybe try again?(y/n)') if prompt == 'n': break else: BaseCheckin.update_sum(obj) sum_records = SumFile.read_file( BaseCheckin.init_sum_name(obj.tea_id, obj.crs_id)) r = range(1, obj.init_seq_id(obj.tea_id, obj.crs_id)) r.append('exit') q = Form(['seq id'], ['once', 'all', 'back']) ch = q.init_form() if ch == len(q.items) or ch == -1: break elif ch == 1: c = Form(['seq id'], r) seq_id = c.init_form() if seq_id == len(r) or seq_id == -1: break sum_format(sum_records, seq_id=seq_id) break sum_format(sum_records) break
def absence(wechat_id): subprocess.call("clear") while True: obj = ManCheckin(wechat_id) if obj.tea_id == 0: print PrtInfo.failedMessage(4) prompt = raw_input('maybe try again?(y/n)') if prompt == 'n': break else: c = BaseCheckin.find_checkin_obj_for_tea(wechat_id) if c != None: temp = [] for stu in c.init_student_records(): auto_rec = c.get_latest_record(stu['StuID'], 'Auto') if auto_rec == {} or auto_rec['IsSuc'] == 'False': auto_rec = { 'StuID': stu['StuID'], 'checkinTime': '?????????????????????', 'ProofPath': 'none', 'checkinType': 'Auto', 'IsSuc': 'False', 'checkinResult': '???' } temp.append(auto_rec) print detail_format(temp) break else: break
def attendence(wechat_id): subprocess.call("clear") while True: obj = ManCheckin(wechat_id) if obj.tea_id == 0: print PrtInfo.failedMessage(4) prompt = raw_input('maybe try again?(y/n)') if prompt == 'n': break else: c = BaseCheckin.find_checkin_obj_for_tea(wechat_id) if c != None: detail_records = BaseFile.read_file( c.init_detail_name(str(c.tea_id), str(c.crs_id), str(c.seq_id))) detail_records = BaseCheckin.filter_invalid_detail_records( detail_records) temp = [] for i in detail_records: if i['IsSuc'] == 'True': temp.append(i) print detail_format(temp) break else: break
def start_manual_menu(wechat_id): subprocess.call("clear") while True: obj = ManCheckin(wechat_id) if obj.tea_id == 0: print PrtInfo.failedMessage(4) prompt = raw_input('maybe try again?(y/n)') if prompt == 'n': break else: obj.add_seq_id(obj.seq_id) obj.write_detail_file(obj.init_detail_records()) obj.update_sum_by_certain_seq_id(obj.seq_id) break
def detail_history(wechat_id): subprocess.call("clear") while True: obj = ManCheckin(wechat_id) if obj.tea_id == 0: print PrtInfo.failedMessage(4) prompt = raw_input('maybe try again?(y/n)') if prompt == 'n': break else: r = range(1, obj.init_seq_id(obj.tea_id, obj.crs_id)) r.append('exit') c = Form(['seq id'], r) seq_id = c.init_form() if seq_id == len(r) or seq_id == -1: break detail_records = DetailFile.read_file( BaseCheckin.init_detail_name(obj.tea_id, obj.crs_id, seq_id)) detail_format(detail_records) break
def detail_now(wechat_id): subprocess.call("clear") while True: obj = ManCheckin(wechat_id) if obj.tea_id == 0: print PrtInfo.failedMessage(4) prompt = raw_input('maybe try again?(y/n)') if prompt == 'n': break else: c = BaseCheckin.find_checkin_obj_for_tea(wechat_id) if c != None: detail_records = BaseFile.read_file( c.init_detail_name(str(c.tea_id), str(c.crs_id), str(c.seq_id))) detail_format(detail_records) break else: break