Exemple #1
0
 def update_db(self, sender):
     t = console.alert('确定要更新数据库?', '', 'Yes')
     if t == 1:
         create_db()
         for i in Path(IMAGEPATH).iterdir():
             if len(list(i.iterdir())) > 2:
                 info = json.loads(
                     i.joinpath('manga_infos.json').open().read())
                 insert_info(info)
         console.hud_alert('完成')
Exemple #2
0
 def get_account_password(self, sender):
     try:
         username, password = console.login_alert('请输入账号密码')
     except KeyboardInterrupt:
         self.close()
     if username and password:
         renew_account(username, password)
         renew()
         init_config()
         create_db()
         get_favcat()
         import conf.global_variables as glv
         glv.init()
         self.present_listview()
         self.close()
Exemple #3
0
def welcome():
    if not is_suitable_device():
        console.hud_alert(ipadpro_iphone_warning, 'error')
    t = dialogs.list_dialog(title="最符合你状况的描述是:",
                            items=choices_list,
                            multiple=False)
    if t == choices_list[0]:
        console.alert(manual[0])
    elif t == choices_list[1]:
        console.alert(manual[1])
    elif t == choices_list[2]:
        console.alert(manual[2])
    elif t == choices_list[3]:
        username, password = console.login_alert('请输入账号密码')
        if username and password:
            renew_account(username, password)
            renew()
            init_config()
            create_db()
Exemple #4
0
def all_init():
    create_db()
    shutil.rmtree(IMAGEPATH)
    shutil.rmtree(CACHEPATH)
    os.makedirs(IMAGEPATH)
    os.makedirs(CACHEPATH)
Exemple #5
0
def rebuild_db():
    create_db()
    for i in Path(IMAGEPATH).iterdir():
        if len(list(i.iterdir())) > 2:
            info = json.loads(i.joinpath('manga_infos.json').open().read())
            insert_info(info)