From c1371a41f40cbdd5b1c0c4ae65c85aab1303f710 Mon Sep 17 00:00:00 2001 From: Peery Date: Mon, 25 Apr 2022 23:13:53 +0200 Subject: [PATCH] Fixed a Bug with URL prediction Fixed an issue where the already set URL was incorrectly read and therefore not taken into account for tag importing. --- ArtNet/gui/importer_window.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ArtNet/gui/importer_window.py b/ArtNet/gui/importer_window.py index 3a5f17b..fd7bdd1 100644 --- a/ArtNet/gui/importer_window.py +++ b/ArtNet/gui/importer_window.py @@ -1,5 +1,6 @@ import validators, os import logging +import re from PyQt5 import QtWidgets from PyQt5.QtCore import Qt, QSize, QUrl @@ -328,7 +329,13 @@ class ImporterWindow(ArtnetMainWindow): Otherwise an empty string :return: """ - return self.ui.link_label.text() + result = re.match('[ a-zA-Z<=>"]*((https|http)://[a-zA-Z0-9]+\.[a-zA-Z0-9]+/[a-zA-Z0-9/]+)', + self.ui.link_label.text()).groups() + if result is not None: + result = result[0] + else: + result = "" + return result def set_presence_label_text(self, presences: list): """ @@ -1004,7 +1011,7 @@ class ImporterWindow(ArtnetMainWindow): logging.info("SpinBox change detected!") result = QtWidgets.QMessageBox.question(self, "Switch Image?", "Do you really want to skip to image #{1} \"{0}\"?" - .format(self.__main.all_images[v], + .format(self.main.all_images[v], v)) if result == QtWidgets.QMessageBox.Yes: self.main.curr_image_index = v