def startDownload(self): if self.downloadRow < self.ui.tableWidget_books.rowCount(): id = _fromQString(self.ui.tableWidget_books.item(self.downloadRow, MainWindow.COLUMN_ID).text()) proxy = self.conf.getProxy() self.downloader = Downloader(id, id, proxy[0], proxy[1], proxy[2]) self.downloader.bind(Downloader.EVT_START, self.cbStart) self.downloader.bind(Downloader.EVT_STOP, self.cbStop) self.downloader.bind(Downloader.EVT_LOG, self.cbLog) self.downloader.bind(Downloader.EVT_PROG, self.cbProgress) self.downloader.start()
def startDownload(self): if self.downloadIdx < self.list.GetItemCount(): id = self.list.GetItemText(self.downloadIdx, MainWindow.COLUMN_ID) proxy = self.conf.getProxy() self.down = Downloader(id, id, proxy[0], proxy[1], proxy[2]) self.down.bind(Downloader.EVT_START, self.cbStart) self.down.bind(Downloader.EVT_STOP, self.cbStop) self.down.bind(Downloader.EVT_LOG, self.cbLog) self.down.bind(Downloader.EVT_PROG, self.cbProgress) self.down.start()
def start(self): # title = _fromQString(self.windowTitle()) bid = _fromQString(self.ui.lineEdit_id.text()) name = _fromQString(self.ui.lineEdit_name.text()) self.when_message('Title: %s' % self.windowTitle().toUtf8()) self.when_message('ID: %s' % bid) self.when_message('Name: %s' % name) self.when_message('downloading...') self.when_message('---------') proxy = self.conf.getProxy() self.downloader = Downloader(bid, name, proxy[0], proxy[1], proxy[2]) self.downloader.bind(Downloader.ON_STOP, self.cbStop) self.downloader.bind(Downloader.EVT_LOG, self.cbLog) self.downloader.bind(Downloader.EVT_PROG, self.cbProgress) self.downloader.start()
def start(self, event): if self.btnDownload.GetValue(): self.gauge.SetValue(10) self.teInfo.Clear() bid = str(self.teId.GetValue()) name = str(self.teName.GetValue()) self.addLog('ID: %s\n' % bid) self.addLog('Name: %s\n' % name) self.addLog('downloading...\n') self.addLog('---------\n') proxy = self.conf.getProxy() self.downloader = Downloader(bid, name, proxy[0], proxy[1], proxy[2]) self.downloader.bind(Downloader.ON_STOP, self.cbStop) self.downloader.bind(Downloader.EVT_LOG, self.cbLog) self.downloader.bind(Downloader.EVT_PROG, self.cbProgress) self.downloader.start() else: self.downloader.stop()