Exemplo n.º 1
0
 def UpdateFavoritesBack(self, backData):
     try:
         if backData.status != Status.Ok:
             return backData.status, self.page
         if backData.res.code == 200:
             info = backData.res.data.get("comics", {})
             self.total = info["total"]
             self.page = info["page"]
             self.pages = info["pages"]
             self.category[self.page] = []
             for bookInfo in info["docs"]:
                 data = CategoryInfo()
                 ToolUtil.ParseFromData(data, bookInfo)
                 self.category[self.page].append(data)
             Log.Info("收藏夹加载成功, page:{}, pages:{}, num:{}".format(
                 self.page, self.pages, self.total))
             return Status.Ok, self.page
         else:
             return Status.Error + backData.res.message, self.page
     except Exception as e:
         import sys
         cur_tb = sys.exc_info()[
             2]  # return (exc_type, exc_value, traceback)
         e = sys.exc_info()[1]
         Log.Error(cur_tb, e)
         return Status.Error + e, self.page
Exemplo n.º 2
0
 def __init__(self, data, isParseRes) -> None:
     super().__init__()
     self.raw = data
     self.data = {}
     self.code = 0
     self.message = ""
     self.reqBak = None
     if isParseRes:
         ToolUtil.ParseFromData(self, self.raw.text)
Exemplo n.º 3
0
 def UpdateCateGoryBack(self, backData):
     for info in backData.res.data.get("categories", {}):
         if info.get("isWeb"):
             continue
         # 兼容下图片加载失败
         if info.get("thumb").get('fileServer') == "https://wikawika.xyz/static/":
             info["thumb"]["fileServer"] = 'https://storage1.picacomic.com'
         newInfo = CateGoryBase()
         ToolUtil.ParseFromData(newInfo, info)
         self.idToCateGoryBase.append(newInfo)
     Log.Info("初始化目录成功。。。")
     return
Exemplo n.º 4
0
    def InitSetting(self):
        for bookId in self.settings.childKeys():
            data = self.settings.value(bookId)
            task = DownloadInfo()
            task.bookId = bookId
            task.status = DownloadStatus.Pause

            ToolUtil.ParseFromData(task, data)

            self.downloadDict[task.bookId] = task
            self.downloadList.append(task)
            rowCont = self.tableWidget.rowCount()
            task.tableRow = rowCont
            self.tableWidget.insertRow(rowCont)
            self.UpdateTableItem(task)
            pass
Exemplo n.º 5
0
 def UpdateFavoritesBack(self, backData):
     try:
         if backData.status != Status.Ok:
             return backData.status, self.page
         if backData.res.code == 200:
             info = backData.res.data.get("comics", {})
             self.total = info["total"]
             self.page = info["page"]
             self.pages = info["pages"]
             self.category[self.page] = []
             for bookInfo in info["docs"]:
                 data = CategoryInfo()
                 ToolUtil.ParseFromData(data, bookInfo)
                 self.category[self.page].append(data)
             Log.Info("收藏夹加载成功, page:{}, pages:{}, num:{}".format(
                 self.page, self.pages, self.total))
             return Status.Ok, self.page
         else:
             return Status.Error + backData.res.message, self.page
     except Exception as es:
         Log.Error(es)
         return Status.Error, self.page