From f2d11a64e480bca652b0d4303e093fa44523f077 Mon Sep 17 00:00:00 2001 From: Tom LAVEILLE Date: Mon, 19 May 2025 15:38:35 +0200 Subject: [PATCH] PyQt5 & PyQt6 --- CenRa_AUTOMAP/CenRa_AutoMap.py | 7 +- CenRa_AUTOMAP/canvas_editor.py | 13 +-- CenRa_COPIE/CenRa_Copie.py | 6 +- CenRa_COPIE/copie_editor.py | 12 +- CenRa_FLUX/CenRa_Flux.py | 6 +- CenRa_FLUX/flux_editor.py | 12 +- CenRa_METABASE/CenRa_Metabase.py | 6 +- CenRa_PAGERENDER/CenRa_PageRender.py | 6 +- CenRa_PAGERENDER/canvas_editor.py | 13 +-- CenRa_PAGERENDER/demoV2.py | 167 --------------------------- CenRa_POSTGIS/CenRa_Postgis.py | 6 +- CenRa_POSTGIS/postgis_creator.py | 13 +-- CenRa_POSTGIS/postgis_editor.py | 13 +-- CenRa_POSTGIS/postgis_rename.py | 13 +-- 14 files changed, 46 insertions(+), 247 deletions(-) delete mode 100644 CenRa_PAGERENDER/demoV2.py diff --git a/CenRa_AUTOMAP/CenRa_AutoMap.py b/CenRa_AUTOMAP/CenRa_AutoMap.py index 6330f87..88362d9 100644 --- a/CenRa_AUTOMAP/CenRa_AutoMap.py +++ b/CenRa_AUTOMAP/CenRa_AutoMap.py @@ -36,10 +36,9 @@ from .canvas_editor import AutoMap_Editor from .style_invoke import AutoMap_Style from .about_form import AboutDialog -try: - from PyQt5.QtCore import * -except: - from PyQt6.QtCore import * + +from qgis.PyQt.QtCore import * + class PgAutoMap: def __init__(self): diff --git a/CenRa_AUTOMAP/canvas_editor.py b/CenRa_AUTOMAP/canvas_editor.py index 87e8edb..4a1005d 100644 --- a/CenRa_AUTOMAP/canvas_editor.py +++ b/CenRa_AUTOMAP/canvas_editor.py @@ -59,14 +59,11 @@ from qgis.PyQt.QtWidgets import ( QTableWidgetItem, QVBoxLayout, ) -try: - from PyQt5.QtCore import QSettings - from PyQt5 import QtGui - from PyQt5 import QtWidgets -except: - from PyQt6.QtCore import QSettings - from PyQt6 import QtGui - from PyQt6 import QtWidgets + +from qgis.PyQt.QtCore import QSettings +from qgis.PyQt import QtGui +from qgis.PyQt import QtWidgets + from qgis.PyQt.QtXml import QDomDocument from qgis.utils import iface diff --git a/CenRa_COPIE/CenRa_Copie.py b/CenRa_COPIE/CenRa_Copie.py index b82c951..c719971 100644 --- a/CenRa_COPIE/CenRa_Copie.py +++ b/CenRa_COPIE/CenRa_Copie.py @@ -24,10 +24,8 @@ pyperclip() from .copie_editor import Copie_Editor from .about_form import AboutDialog -try: - from PyQt5.QtCore import * -except: - from PyQt6.QtCore import * +from qgis.PyQt.QtCore import * + class PgCopie: def __init__(self): """ Constructor. """ diff --git a/CenRa_COPIE/copie_editor.py b/CenRa_COPIE/copie_editor.py index 803e058..7900ff1 100644 --- a/CenRa_COPIE/copie_editor.py +++ b/CenRa_COPIE/copie_editor.py @@ -9,14 +9,10 @@ import qgis from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog from qgis.PyQt.QtGui import QIcon -try: - from PyQt5.QtCore import * - from PyQt5.QtGui import * - from PyQt5 import QtGui -except: - from PyQt6.QtCore import * - from PyQt6.QtGui import * - from PyQt6 import QtGui + +from qgis.PyQt.QtCore import * +from qgis.PyQt.QtGui import * +from qgis.PyQt import QtGui from qgis.core import * from qgis.core import QgsDataSourceUri diff --git a/CenRa_FLUX/CenRa_Flux.py b/CenRa_FLUX/CenRa_Flux.py index bfb6c97..5c12c75 100644 --- a/CenRa_FLUX/CenRa_Flux.py +++ b/CenRa_FLUX/CenRa_Flux.py @@ -24,10 +24,8 @@ pyperclip() from .flux_editor import Flux_Editor from .about_form import AboutDialog -try: - from PyQt5.QtCore import * -except: - from PyQt6.QtCore import * +from qgis.PyQt.QtCore import * + class PgFlux: def __init__(self): diff --git a/CenRa_FLUX/flux_editor.py b/CenRa_FLUX/flux_editor.py index b050118..d0c3e58 100644 --- a/CenRa_FLUX/flux_editor.py +++ b/CenRa_FLUX/flux_editor.py @@ -11,14 +11,10 @@ from qgis.PyQt.QtCore import QSettings from qgis.PyQt import QtWidgets from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog from qgis.PyQt.QtGui import QIcon -try: - from PyQt5.QtCore import * - from PyQt5.QtGui import * - from PyQt5 import QtGui -except: - from PyQt6.QtCore import * - from PyQt6.QtGui import * - from PyQt6 import QtGui + +from qgis.PyQt.QtCore import * +from qgis.PyQt.QtGui import * +from qgis.PyQt import QtGui from qgis.core import * from qgis.core import QgsDataSourceUri diff --git a/CenRa_METABASE/CenRa_Metabase.py b/CenRa_METABASE/CenRa_Metabase.py index 7f51494..ad2254f 100644 --- a/CenRa_METABASE/CenRa_Metabase.py +++ b/CenRa_METABASE/CenRa_Metabase.py @@ -36,10 +36,8 @@ from .editor import Metabase_Editor from .about_form import MetabaseAboutDialog #from CenRa_Metabase.issues import CenRa_Issues -try: - from PyQt5.QtCore import * -except: - from PyQt6.QtCore import * +from qgis.PyQt.QtCore import * + class PgMetadata: def __init__(self): diff --git a/CenRa_PAGERENDER/CenRa_PageRender.py b/CenRa_PAGERENDER/CenRa_PageRender.py index cde5b69..cf8bd43 100644 --- a/CenRa_PAGERENDER/CenRa_PageRender.py +++ b/CenRa_PAGERENDER/CenRa_PageRender.py @@ -32,10 +32,8 @@ from .tools.resources import ( from .canvas_editor import PageRender_Editor from .about_form import AboutDialog -try: - from PyQt5.QtCore import * -except: - from PyQt6.QtCore import * +from qgis.PyQt.QtCore import * + class PgPageRender: def __init__(self): diff --git a/CenRa_PAGERENDER/canvas_editor.py b/CenRa_PAGERENDER/canvas_editor.py index 2e76d23..b8317a3 100644 --- a/CenRa_PAGERENDER/canvas_editor.py +++ b/CenRa_PAGERENDER/canvas_editor.py @@ -56,14 +56,11 @@ from qgis.PyQt.QtWidgets import ( QTableWidgetItem, QVBoxLayout, ) -try: - from PyQt5 import QtGui - from PyQt5.QtWidgets import QApplication - from PyQt5.QtCore import QSettings,QPointF -except: - from PyQt6 import QtGui - from PyQt6.QtWidgets import QApplication - from PyQt6.QtCore import QSettings,QPointF + +from qgis.PyQt import QtGui +from qgis.PyQt.QtWidgets import QApplication +from qgis.PyQt.QtCore import QSettings,QPointF + from qgis.PyQt.QtXml import QDomDocument from qgis.utils import iface import glob diff --git a/CenRa_PAGERENDER/demoV2.py b/CenRa_PAGERENDER/demoV2.py deleted file mode 100644 index ce5546f..0000000 --- a/CenRa_PAGERENDER/demoV2.py +++ /dev/null @@ -1,167 +0,0 @@ - -from qgis.core import ( - QgsLayoutSize, - QgsUnitTypes, - QgsLayoutPoint, -) -def fletch_canvas(self): - if self.radioButton_6.isChecked(): - values_page = 'A4' - else: - values_page = 'A3' - if self.radioButton_7.isChecked(): - page_rotate = 'Portrait' - else: - page_rotate = 'Landscape' - - if page_rotate == 'Portrait': - if values_page == 'A4': - self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 2, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_rotate'] = 0 - self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571,69, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_rotate'] = 0 - self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571,131, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_rotate'] = 0 - self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_rotate'] = 0 - self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_rotate'] = 0 - self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_rotate'] = 0 - self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_rotate'] = 0 - self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_rotate'] = 0 - self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_rotate'] = 0 - self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_rotate'] = 0 - self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_rotate'] = 0 - self.template_parameters['Logo_2_size'] = QgsLayoutSize(122.0,45, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(31, 21, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_rotate'] = 0 - if values_page == 'A3': - self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_rotate'] = 0 - self.template_parameters['Carte_2_size'] = QgsLayoutSize(121,97, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(295, 4, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_rotate'] = 0 - self.template_parameters['Legande_size'] = QgsLayoutSize(121,185, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_locals'] = QgsLayoutPoint(295, 104, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_rotate'] = 0 - self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_locals'] = QgsLayoutPoint(267, 28, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_rotate'] = 0 - self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_locals'] = QgsLayoutPoint(13, 278, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_rotate'] = 0 - self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_rotate'] = 0 - self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_locals'] = QgsLayoutPoint(72, 4, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_rotate'] = 0 - self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_locals'] = QgsLayoutPoint(213, 278, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_rotate'] = 0 - self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_locals'] = QgsLayoutPoint(323, 278, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_rotate'] = 0 - self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_rotate'] = 0 - self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(13, 259, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_rotate'] = 0 - self.template_parameters['Logo_2_size'] = QgsLayoutSize(172,64, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(44, 29, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_rotate'] = 0 - if page_rotate == 'Landscape': - if values_page == 'A4': - self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 2, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_rotate'] = 0 - self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571,69, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_rotate'] = 0 - self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571,131, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_rotate'] = 0 - self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_rotate'] = 0 - self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_rotate'] = 0 - self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_rotate'] = 0 - self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_rotate'] = 0 - self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_rotate'] = 0 - self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_rotate'] = 0 - self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_rotate'] = 0 - self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_rotate'] = 0 - self.template_parameters['Logo_2_size'] = QgsLayoutSize(122.0,45, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(31, 21, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_rotate'] = 0 - if values_page == 'A3': - self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 3, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_rotate'] = 0 - self.template_parameters['Carte_2_size'] = QgsLayoutSize(121,97, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(295, 4, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Carte_2_rotate'] = 0 - self.template_parameters['Legande_size'] = QgsLayoutSize(121,185, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_locals'] = QgsLayoutPoint(295, 104, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Legande_rotate'] = 0 - self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_locals'] = QgsLayoutPoint(267, 28, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Arrow_rotate'] = 0 - self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_locals'] = QgsLayoutPoint(13, 278, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_rotate'] = 0 - self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_rotate'] = 0 - self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_locals'] = QgsLayoutPoint(72, 4, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Titre_rotate'] = 0 - self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_locals'] = QgsLayoutPoint(213, 278, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Credit_rotate'] = 0 - self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_locals'] = QgsLayoutPoint(323, 278, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Source_rotate'] = 0 - self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Sous_titre_rotate'] = 0 - self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(13, 259, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Echelle_2_rotate'] = 0 - self.template_parameters['Logo_2_size'] = QgsLayoutSize(172,64, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(44, 29, QgsUnitTypes.LayoutMillimeters) - self.template_parameters['Logo_2_rotate'] = 0 - return self.template_parameters diff --git a/CenRa_POSTGIS/CenRa_Postgis.py b/CenRa_POSTGIS/CenRa_Postgis.py index bcd90f7..a1dba92 100644 --- a/CenRa_POSTGIS/CenRa_Postgis.py +++ b/CenRa_POSTGIS/CenRa_Postgis.py @@ -28,10 +28,8 @@ from .postgis_creator import Postgis_Creator from .postgis_rename import Postgis_Rename from .about_form import AboutDialog -try: - from PyQt5.QtCore import * -except: - from PyQt6.QtCore import * +from qgis.PyQt.QtCore import * + IPAddr=socket.gethostbyname(socket.gethostname()) diff --git a/CenRa_POSTGIS/postgis_creator.py b/CenRa_POSTGIS/postgis_creator.py index 9e82dc0..003fe00 100644 --- a/CenRa_POSTGIS/postgis_creator.py +++ b/CenRa_POSTGIS/postgis_creator.py @@ -9,14 +9,11 @@ import qgis from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog,QMessageBox from qgis.PyQt.QtGui import QIcon -try: - from PyQt5.QtCore import * - from PyQt5.QtGui import * - from PyQt5 import QtGui -except: - from PyQt6.QtCore import * - from PyQt6.QtGui import * - from PyQt6 import QtGui + +from qgis.PyQt.QtCore import * +from qgis.PyQt.QtGui import * +from qgis.PyQt import QtGui + from qgis.core import * from qgis.core import QgsDataSourceUri diff --git a/CenRa_POSTGIS/postgis_editor.py b/CenRa_POSTGIS/postgis_editor.py index cb71c3e..03d27ff 100644 --- a/CenRa_POSTGIS/postgis_editor.py +++ b/CenRa_POSTGIS/postgis_editor.py @@ -9,14 +9,11 @@ import qgis from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog from qgis.PyQt.QtGui import QIcon -try: - from PyQt5.QtCore import * - from PyQt5.QtGui import * - from PyQt5 import QtGui -except: - from PyQt6.QtCore import * - from PyQt6.QtGui import * - from PyQt6 import QtGui + +from qgis.PyQt.QtCore import * +from qgis.PyQt.QtGui import * +from qgis.PyQt import QtGui + from qgis.core import * from qgis.core import QgsDataSourceUri diff --git a/CenRa_POSTGIS/postgis_rename.py b/CenRa_POSTGIS/postgis_rename.py index 3ec9245..10701a8 100644 --- a/CenRa_POSTGIS/postgis_rename.py +++ b/CenRa_POSTGIS/postgis_rename.py @@ -9,14 +9,11 @@ import qgis from qgis.PyQt.QtCore import QSettings from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog, QMessageBox,QDialogButtonBox from qgis.PyQt.QtGui import QIcon -try: - from PyQt5.QtCore import * - from PyQt5.QtGui import * - from PyQt5 import QtGui -except: - from PyQt6.QtCore import * - from PyQt6.QtGui import * - from PyQt6 import QtGui + +from qgis.PyQt.QtCore import * +from qgis.PyQt.QtGui import * +from qgis.PyQt import QtGui + from qgis.core import * from qgis.core import QgsDataSourceUri