Beispiel #1
0
def encrypt_passwords():
    import buu_model, buu_database
    database_op = buu_database.class_database_op()
    exist_cards = buu_model.class_model.Card.select()

    for card in exist_cards:
        database_op.save_card_info(card.user.id, card.user_name, card.password)
Beispiel #2
0
 def __init__(self):
     self.config = buu_config.config
     self.session = requests.Session()
     self.has_login_vpn = False
     self.has_login_mybuu = False
     self.has_login_card = False
     self.class_database_op = buu_database.class_database_op()
Beispiel #3
0
    def __init__(self):
        self.class_database_op = buu_database.class_database_op()

        self.config = buu_config.config
        self.command_dict_class = buu_command_dict.class_command_dict()
        self.command_dict = self.command_dict_class.command_dict

        self.thread_pool = ThreadPoolExecutor(max_workers=10)
Beispiel #4
0
 def __init__(self):
     self.step_dict = [  \
                         (None, None), \
                         (self.print_job_add, None), \
                         (self.add_printer, None), \
                         (self.printer_manager, None)
                     ]
     self.config = buu_config.config
     self.class_database_op = buu_database.class_database_op()
     self.allow_ext = ['.doc', '.docx', '.pdf']
Beispiel #5
0
 def __init__(self):
     self.step_dict = [  \
                         (None, None), \
                         (self.list_admin, None), \
                         (self.who_am_i, None), \
                         (self.sys_info, None), \
                         (self.about, None) \
                     ]
     self.config = buu_config.config
     self.class_database_op = buu_database.class_database_op()
Beispiel #6
0
 def __init__(self):
     self.config = buu_config.config
     requests.packages.urllib3.disable_warnings()
     self.session = requests.Session()
     self.has_login_vpn = False
     self.has_login_mybuu = False
     self.has_login_card = False
     self.has_login_jwxt = False
     self.stu_jwxt_url = ''
     self.has_login_lib = False
     self.class_database_op = buu_database.class_database_op()
Beispiel #7
0
 def __init__(self):
     self.step_dict = [  \
                         (None, None), \
                         (self.input_card_info, None), \
                         (self.get_card_info, None), \
                         (self.balance_check, None), \
                         (self.card_consume_notice_enable, None), \
                         (self.card_balance_notice_enable, None), \
                         (self.card_get_log, None) \
                     ]
     self.config = buu_config.config
     self.class_database_op = buu_database.class_database_op()
Beispiel #8
0
 def __init__(self):
     self.step_dict = [  \
                         (None, None), \
                         (self.test, None), \
                         (self.input_lib_info, None), \
                         (self.get_lib_info, None), \
                         (self.get_lend_book_info, None), \
                         (self.book_back_notice_enable, None), \
                         (self.renew_lend_book, None), \
                         (self.book_auto_renew_enable, None), \
                     ]
     self.config = buu_config.config
     self.class_database_op = buu_database.class_database_op()
Beispiel #9
0
 def __init__(self):
     self.step_dict = [  \
                         (None, None), \
                         (self.test, None), \
                         (self.export_to_ical, None), \
                         (self.input_jwxt_info, None), \
                         (self.get_jwxt_info, None), \
                         (self.get_exam_list, None), \
                         (self.get_exam_cal, None), \
                         (self.auto_rank_lesson, None), \
                     ]
     self.config = buu_config.config
     self.class_database_op = buu_database.class_database_op()
Beispiel #10
0
 def __init__(self):
     self.step_dict = [  \
                         (None, None), \
                         (self.list_admin, None), \
                         (self.who_am_i, None), \
                         (self.sys_info, None), \
                         (self.about, None), \
                         (None, None), \
                         (self.test_inner_net_login, None), \
                         (self.baidu_wenku_download, None), \
                     ]
     self.config = buu_config.config
     self.class_database_op = buu_database.class_database_op()
Beispiel #11
0
    def __init__(self):
        self.buu_step4_menu = buu_step4_menu.class_step()
        self.buu_step1_menu = buu_step1_menu.class_step()

        self.command_dict = [  \
                                (self.step_0_tips, None), \
                                (self.buu_step1_menu.step_dict, self.buu_step1_menu.step_tips), \
                                (self.under_constuct_tips, None), \
                                (self.under_constuct_tips, None), \
                                (self.buu_step4_menu.step_dict, self.buu_step4_menu.step_tips),
                                (self.under_constuct_tips, None) \
                            ]

        self.command_dict = (self.command_dict, self.command_dict)

        self.config = buu_config.config
        self.class_database_op = buu_database.class_database_op()
Beispiel #12
0
    def run(self):
        friends = itchat.get_friends(True)

        for friend in friends:
            try:
                if friend.RemarkName:
                    user_id = int(friend.RemarkName)
                    new_user_id = class_database_op.update_user(friend.UserName, user_id)
                    if new_user_id:
                        itchat.set_alias(friend.UserName, str(user_id))
                        user_id = new_user_id
                else:
                    user_id = self.class_database_op.put_user(friend.UserName)
                    itchat.set_alias(friend.UserName, str(user_id))
            except:
                pass

        database_op = buu_database.class_database_op()
Beispiel #13
0
    itchat.add_friend(**msg['Text']) # 该操作会自动将新好友的消息录入,不需要重载通讯录
    itchat.send_msg("欢迎~对我说话来获取菜单吧~", msg['RecommendInfo']['UserName'])

def encrypt_passwords():
    import buu_model, buu_database
    database_op = buu_database.class_database_op()
    exist_cards = buu_model.class_model.Card.select()

    for card in exist_cards:
        print("正在处理... ID:%d" %(card.user.id))
        database_op.save_card_info(card.user.id, card.user_name, card.password)

def exit_callback():
    itchat.auto_login(enableCmdQR=2, hotReload=True, exitCallback=exit_callback)
    itchat.run()

buu_model.class_model.init()

msg_handler = buu_msg_handle.class_msg_handle()

itchat.auto_login(enableCmdQR=2, hotReload=True, exitCallback=exit_callback)

class_database_op = buu_database.class_database_op()
class_database_op.flush_redis()

buu_thread_read_remark.class_init_thread()

# encrypt_passwords()

itchat.run()
 def __init__(self, thread_pool):
     threading.Thread.__init__(self)
     self.class_database_op = buu_database.class_database_op()
     self.thread_pool = thread_pool