ui_main.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:python-get-girl-image 作者: JadenTseng 项目源码 文件源码
def slot_startDownload(self):
        url = self.urlL_ineEdit.text()
        path = self.save_path_lineEdit.text()
        type = self.comboBox.currentIndex()
        try:
            if url is None or url.strip() == "":
                QMessageBox.information(self, "??", "????????", QMessageBox.Yes)
            elif not re.match('http:\/\/.*?\/', url):
                QMessageBox.information(self, "??", "????????", QMessageBox.Yes)
            elif path is None or path.strip() == "":
                QMessageBox.information(self, "??", "??????????", QMessageBox.Yes)
            else:
                html = GetMezi._get_html(url)
                soup = GetMezi._get_soup(html)
                if self.TYPE_MORE == type:
                    albums = GetMezi._get_img_dirs(soup)
                    if None == albums:
                        QMessageBox.information(self, "??", "???????????????????????????????????????????", QMessageBox.Yes)
                    else:
                        QMessageBox.information(self, "??", "?????...", QMessageBox.Yes)
                        self.downloadButton.setDisabled(True)
                        self.bwThread = AlbumsThread(path, albums)
                        self.bwThread.finishSignal.connect(self.resetDownloadBtn)
                        self.bwThread.start()

                elif self.TYPE_SINGLE == type:
                    title = GetMezi._get_page_title(soup)
                    QMessageBox.information(self, "??", "?????...", QMessageBox.Yes)
                    self.downloadButton.setDisabled(True)
                    self.bwThread = SingleAlbumThread(path, title, url)
                    self.bwThread.finishSignal.connect(self.resetDownloadBtn)
                    self.bwThread.start()

        except Exception as e:
            print(e)
            QMessageBox.information(self, "??", "???‘????’?‘????’?????\n ??????????????\n ???http://www.mzitu.com/ \n ? http://www.mzitu.com/xinggan \n ????????????????\n http://www.mzitu.com/75636 ", QMessageBox.Yes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号