예제 #1
0
def ImportFromPNG(win: QW.QWidget,
                  gallery_seed_log: ClientImportGallerySeeds.GallerySeedLog,
                  can_generate_more_pages: bool):

    with QP.FileDialog(win,
                       'select the png with the urls',
                       wildcard='PNG (*.png)') as dlg:

        if dlg.exec() == QW.QDialog.Accepted:

            path = dlg.GetPath()

            try:

                payload_string = ClientSerialisable.LoadStringFromPNG(path)

                urls = GetURLsFromURLsString(payload_string)

                ImportURLs(win, gallery_seed_log, urls,
                           can_generate_more_pages)

            except:

                QW.QMessageBox.critical(win, 'Error', 'Could not import!')

                raise
예제 #2
0
    def _ImportFromPNG(self):

        with QP.FileDialog(self,
                           'select the png with the urls',
                           wildcard='PNG (*.png)') as dlg:

            if dlg.exec() == QW.QDialog.Accepted:

                path = dlg.GetPath()

                try:

                    payload_string = ClientSerialisable.LoadStringFromPNG(path)

                    urls = self._GetURLsFromURLsString(payload_string)

                    self._ImportURLs(urls)

                except:

                    QW.QMessageBox.critical(self, 'Error', 'Could not import!')

                    raise
예제 #3
0
def ImportFromPNG(win: QW.QWidget,
                  file_seed_cache: ClientImportFileSeeds.FileSeedCache):

    with QP.FileDialog(win,
                       'select the png with the sources',
                       wildcard='PNG (*.png)') as dlg:

        if dlg.exec() == QW.QDialog.Accepted:

            path = dlg.GetPath()

            try:

                payload_string = ClientSerialisable.LoadStringFromPNG(path)

                sources = GetSourcesFromSourcesString(payload_string)

                ImportSources(file_seed_cache, sources)

            except:

                QW.QMessageBox.critical(win, 'Error', 'Could not import!')

                raise