コード例 #1
0
    def checkBaseFile(self):
        self.dlg = wx.ProgressDialog(
            "WikiReader Updater",
            "Checking base files ...",
            maximum=100,
            parent=self,
            style=0
            | wx.PD_APP_MODAL
            #| wx.PD_CAN_ABORT
            #| wx.PD_CAN_SKIP
            #| wx.PD_ELAPSED_TIME
            #| wx.PD_ESTIMATED_TIME
            #| wx.PD_REMAINING_TIME
            | wx.PD_AUTO_HIDE)

        base = kPackages['bases'][0]
        baseFile = base['files'][0]
        if not disk.checkFileSize(baseFile['name'], baseFile['size']):
            self.dlg.Update(0, "Downloading base files ...")
            download.downloadPackage(self,
                                     base,
                                     callback=self.finishBaseFile,
                                     updateback=self.updateBaseFile)
        else:
            self.dlg.Update(100)  # set 100 to close the dlg
            self.finishBaseFile()
コード例 #2
0
    def finishDownload(self):
        if self:
            self.packagesListCtrl.SetStringItem(self.currentDownloadIndex, 1, "100%")
            self.packagesListCtrl.SetStringItem(self.currentDownloadIndex, 2, "Finished")
            self.currentDownloadIndex = self.currentDownloadIndex + 1

            if len(checkedItems) == self.currentDownloadIndex:
                self.parent.GoPrepareInstall()
            else:
                download.downloadPackage(self, kPackages['volumes'][checkedItems[self.currentDownloadIndex]], callback=self.finishDownload, updateback=self.updateProgress)
コード例 #3
0
    def finishDownload(self):
        if self:
            self.packagesListCtrl.SetStringItem(self.currentDownloadIndex, 1,
                                                "100%")
            self.packagesListCtrl.SetStringItem(self.currentDownloadIndex, 2,
                                                "Finished")
            self.currentDownloadIndex = self.currentDownloadIndex + 1

            if len(checkedItems) == self.currentDownloadIndex:
                self.parent.GoPrepareInstall()
            else:
                download.downloadPackage(self,
                                         kPackages['volumes'][checkedItems[
                                             self.currentDownloadIndex]],
                                         callback=self.finishDownload,
                                         updateback=self.updateProgress)
コード例 #4
0
    def checkBaseFile(self):
        self.dlg = wx.ProgressDialog("WikiReader Updater",
                               "Checking base files ...",
                               maximum = 100,
                               parent=self,
                               style = 0
                                | wx.PD_APP_MODAL
                                #| wx.PD_CAN_ABORT
                                #| wx.PD_CAN_SKIP
                                #| wx.PD_ELAPSED_TIME
                                #| wx.PD_ESTIMATED_TIME
                                #| wx.PD_REMAINING_TIME
                                | wx.PD_AUTO_HIDE
                                )

        base = kPackages['bases'][0]
        baseFile = base['files'][0]
        if not disk.checkFileSize(baseFile['name'], baseFile['size']):
            self.dlg.Update(0, "Downloading base files ...")
            download.downloadPackage(self, base, callback=self.finishBaseFile, updateback=self.updateBaseFile)
        else:
            self.dlg.Update(100) # set 100 to close the dlg
            self.finishBaseFile()
コード例 #5
0
 def downloadStart(self):
     download.downloadPackage(self,
                              kPackages['volumes'][checkedItems[0]],
                              callback=self.finishDownload,
                              updateback=self.updateProgress)
コード例 #6
0
 def downloadStart(self):
     download.downloadPackage(self, kPackages['volumes'][checkedItems[0]], callback=self.finishDownload, updateback=self.updateProgress)