Compare commits

..
4 Commits
Author SHA1 Message Date
tlaveille c809c12c9f Optimisation pour TT 2025-04-09 11:44:05 +02:00
tlaveille bc538524fb releases to latest 2025-04-07 17:30:36 +02:00
tlaveille 23f21a4c39 releases to latest 2025-04-07 17:29:22 +02:00
tlaveille 2b00cf9106 debug 2025-04-07 16:06:33 +02:00
15 changed files with 104 additions and 99 deletions
+5 -10
View File
@@ -4,7 +4,7 @@ import configparser
import shutil
import tempfile
import base64
import socket
import os
import psycopg2
import psycopg2.extras
from os.path import abspath, join, pardir, dirname
@@ -109,14 +109,9 @@ def load_ui(*args):
return ui_class
def pyperclip():
IPAddr=socket.gethostbyname(socket.gethostname())
dst = abspath(abspath(join(plugin_path(), "CenRa_AUTOMAP\\tools\\")))
if IPAddr[0:11] == "100.100.100": #4269
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
if IPAddr[0:9] == "192.168.0": #01
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
if IPAddr[0:9] == "192.168.1": #0726
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
dst = dirname(dirname(__file__))+"\\tools\\"
if os.access('N:/',os.R_OK):
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/StyleLayer.py'
try:
shutil.copy(src, dst)
except:
@@ -154,7 +149,7 @@ def maj_verif(NAME):
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
+1 -5
View File
@@ -70,11 +70,7 @@ class PgCopie:
self.copie_editor.triggered.connect(self.open_editor)
self.copie_editor.setEnabled(False)
IPAddr=socket.gethostbyname(socket.gethostname())
if IPAddr[0:11] == "100.100.100":
self.copie_editor.setEnabled(True)
elif IPAddr[0:9] == "192.168.0":
self.copie_editor.setEnabled(True)
elif IPAddr[0:9] == "192.168.1":
if os.access('N:/',os.R_OK):
self.copie_editor.setEnabled(True)
def open_about_dialog(self):
+6 -11
View File
@@ -6,7 +6,7 @@ import tempfile
import base64
import psycopg2
import psycopg2.extras
import socket
import os
from os.path import abspath, join, pardir, dirname
from qgis.PyQt import uic
@@ -90,7 +90,7 @@ def resources_path(*args):
:return: Absolute path to the resources folder.
:rtype: str
"""
path = abspath(abspath(join(plugin_path(), "CenRa_Copie\\tools")))
path = abspath(abspath(join(plugin_path(), "CenRa_COPIE\\tools")))
for item in args:
path = abspath(join(path, item))
return path
@@ -109,14 +109,9 @@ def load_ui(*args):
return ui_class
def pyperclip():
IPAddr=socket.gethostbyname(socket.gethostname())
dst = abspath(abspath(join(plugin_path(), "CenRa_Copie\\tools\\")))
if IPAddr[0:11] == "100.100.100": #4269
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.0": #01
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.1": #0726
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
dst = dirname(dirname(__file__))+"\\tools\\"
if os.access('N:/',os.R_OK):
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
try:
shutil.copy(src, dst)
except:
@@ -154,7 +149,7 @@ def maj_verif(NAME):
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
+1 -6
View File
@@ -70,12 +70,7 @@ class PgFlux:
self.toolBar.addAction(self.flux_editor)
self.flux_editor.triggered.connect(self.open_editor)
self.flux_editor.setEnabled(False)
IPAddr=socket.gethostbyname(socket.gethostname())
if IPAddr[0:11] == "100.100.100":
self.flux_editor.setEnabled(True)
elif IPAddr[0:9] == "192.168.0":
self.flux_editor.setEnabled(True)
elif IPAddr[0:9] == "192.168.1":
if os.access('N:/',os.R_OK):
self.flux_editor.setEnabled(True)
def open_about_dialog(self):
+24
View File
@@ -50,6 +50,9 @@ import psycopg2
import psycopg2.extras
import base64
global DeBUG
DeBUG = 0
try:
account = login_base('account')
user = account[0]
@@ -60,6 +63,8 @@ try:
sigdb = account[5]
refdb = account[6]
except:
print('')
EDITOR_CLASS = load_ui('CenRa_Flux_base.ui')
@@ -211,6 +216,12 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
self.viewer.titleChanged.connect(self.NewTitle)
layout.addWidget(self.lineEdit)
self.viewer.hide()
self.DeBUG.addItem('')
self.DeBUG.addItem('01')
self.DeBUG.addItem('0726')
self.DeBUG.addItem('4269')
self.DeBUG.hide()
#self.lineEdit.mousePressEvent = self._mousePressEvent
#metadonnees_plugin = open(self.plugin_path + '/metadata.txt')
@@ -219,6 +230,19 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
def raise_(self):
"""Run method that performs all the real work"""
self.bd_source()
def ModeDeBUG(self):
self.DeBUG.show()
def mousePressEvent(self, event):
global DeBUG
if 330 <= event.pos().x() <= 560 and 5 <= event.pos().y() <= 75:
DeBUG = DeBUG+1
if DeBUG == 3:
DeBUG = 0
self.ModeDeBUG()
else:
DeBUG = 0
self.DeBUG.hide()
def NewTitle(self):
if self.viewer.title() != '':
+2 -2
View File
@@ -6,7 +6,7 @@
name=CenRa_FLUX
qgisMinimumVersion=3.0
description=Permet d'ouvrire une table dans la base PostGis
version=2.6
version=2.7
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -32,7 +32,7 @@ icon=icon.png
# experimental flag
experimental=False
changelog=<h2>CenRa_FLUX:</h2></br><p><h3>03/04/2025 - Version 2.6: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 2.5: </h3> - Visualisation distincte des couches ne se trouvant pas dans l'antenne.</p></br><p><h3>13/02/2025 - Version 2.4: </h3> - Ajoute redimensionnement et déplacement mollette.</p></br><p><h3>05/02/2025 - Version 2.3: </h3> - Bouton de visualisation des couches se trouvent uniquement dans le canva de la carte.</p></br><p><h3>07/01/2025 - Version 2.2: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.1:</h3> - Correctif de bug.</br> - Evolution de la limit de 3 à 5. </br></p></br><p><h3>22/10/2024 - Version 2.0:</h3> - Reformatage du code.</br></p></br><p><h3>03/10/2024 - Version 1.14:</h3> - Remonte la fênetre dans la pille.</br></p><p><h3>13/09/2024 - Version 1.13:</h3>- MAJ sur le lien du changelog</br>- Bug-fix: Ouvre MultiPolygone et Polygon séparément.</p></br><p><h3>10/09/2024 - Version 1.11:</h3>- Ouverture de table contenant plusieurs géométries.</p></br><p><h3>26/08/2024 - Version 1.10:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
changelog=<h2>CenRa_FLUX:</h2></br><p><h3>07/04/2025 - Version 2.7: </h3> - mode debug.</p></br><p><h3>03/04/2025 - Version 2.6: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 2.5: </h3> - Visualisation distincte des couches ne se trouvant pas dans l'antenne.</p></br><p><h3>13/02/2025 - Version 2.4: </h3> - Ajoute redimensionnement et déplacement mollette.</p></br><p><h3>05/02/2025 - Version 2.3: </h3> - Bouton de visualisation des couches se trouvent uniquement dans le canva de la carte.</p></br><p><h3>07/01/2025 - Version 2.2: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.1:</h3> - Correctif de bug.</br> - Evolution de la limit de 3 à 5. </br></p></br><p><h3>22/10/2024 - Version 2.0:</h3> - Reformatage du code.</br></p></br><p><h3>03/10/2024 - Version 1.14:</h3> - Remonte la fênetre dans la pille.</br></p><p><h3>13/09/2024 - Version 1.13:</h3>- MAJ sur le lien du changelog</br>- Bug-fix: Ouvre MultiPolygone et Polygon séparément.</p></br><p><h3>10/09/2024 - Version 1.11:</h3>- Ouverture de table contenant plusieurs géométries.</p></br><p><h3>26/08/2024 - Version 1.10:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
# deprecated flag (applies to the whole plugin, not just a single version)
deprecated=False
+5 -10
View File
@@ -2,7 +2,7 @@
import configparser
import shutil
import socket
import os
import tempfile
from os.path import abspath, join, pardir, dirname
@@ -78,14 +78,9 @@ def plugin_test_data_path(*args, copy=False):
return path
def pyperclip():
IPAddr=socket.gethostbyname(socket.gethostname())
dst = abspath(abspath(join(plugin_path(), "CenRa_FLUX\\tools\\")))
if IPAddr[0:11] == "100.100.100": #4269
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.0": #01
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.1": #0726
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
dst = dirname(dirname(__file__))+"\\tools\\"
if os.access('N:/',os.R_OK):
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
try:
shutil.copy(src, dst)
except:
@@ -149,7 +144,7 @@ def maj_verif(NAME):
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
+37
View File
@@ -357,6 +357,43 @@
<string/>
</property>
</widget>
<widget class="QComboBox" name="DeBUG">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>71</width>
<height>22</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string notr="true"/>
</property>
</widget>
<zorder>viewer</zorder>
<zorder>commandLinkButton_2</zorder>
<zorder>pushButton_2</zorder>
<zorder>label</zorder>
<zorder>tableWidget_2</zorder>
<zorder>comboBox</zorder>
<zorder>lineEdit</zorder>
<zorder>toolButton</zorder>
<zorder>tableWidget</zorder>
<zorder>label_2</zorder>
<zorder>label_3</zorder>
<zorder>comboBox_2</zorder>
<zorder>commandLinkButton</zorder>
<zorder>checkBox</zorder>
<zorder>DeBUG</zorder>
</widget>
</widget>
</item>
+5 -10
View File
@@ -3,7 +3,7 @@
import configparser
import shutil
import tempfile
import socket
import os
from os.path import abspath, join, pardir, dirname
from qgis.PyQt.QtWidgets import QApplication
from qgis.PyQt import uic
@@ -93,14 +93,9 @@ def resources_path(*args):
return path
def pyperclip():
IPAddr=socket.gethostbyname(socket.gethostname())
dst = abspath(abspath(join(plugin_path(), "CenRa_METABASE\\tools\\")))
if IPAddr[0:11] == "100.100.100": #4269
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.0": #01
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.1": #0726
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
dst = dirname(dirname(__file__))+"\\tools\\"
if os.access('N:/',os.R_OK):
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
try:
shutil.copy(src, dst)
except:
@@ -150,7 +145,7 @@ def maj_verif(NAME):
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
+1 -1
View File
@@ -139,7 +139,7 @@ def maj_verif(NAME):
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
+3 -15
View File
@@ -80,11 +80,7 @@ class PgPostgis:
self.postgis_creator.triggered.connect(self.open_creator)
self.postgis_creator.setEnabled(False)
if IPAddr[0:11] == "100.100.100":
self.postgis_creator.setEnabled(True)
elif IPAddr[0:9] == "192.168.0":
self.postgis_creator.setEnabled(True)
elif IPAddr[0:9] == "192.168.1":
if os.access('N:/',os.R_OK):
self.postgis_creator.setEnabled(True)
if not self.action_editor:
@@ -95,11 +91,7 @@ class PgPostgis:
self.postgis_editor.triggered.connect(self.open_editor)
self.postgis_editor.setEnabled(False)
if IPAddr[0:11] == "100.100.100":
self.postgis_editor.setEnabled(True)
elif IPAddr[0:9] == "192.168.0":
self.postgis_editor.setEnabled(True)
elif IPAddr[0:9] == "192.168.1":
if os.access('N:/',os.R_OK):
self.postgis_editor.setEnabled(True)
if not self.action_rename:
@@ -119,11 +111,7 @@ class PgPostgis:
self.postgis_rename.setVisible(0)
self.postgis_rename.setEnabled(False)
if IPAddr[0:11] == "100.100.100":
self.postgis_rename.setEnabled(True)
elif IPAddr[0:9] == "192.168.0":
self.postgis_rename.setEnabled(True)
elif IPAddr[0:9] == "192.168.1":
if os.access('N:/',os.R_OK):
self.postgis_rename.setEnabled(True)
def open_about_dialog(self):
+5 -10
View File
@@ -6,7 +6,7 @@ import tempfile
import base64
import psycopg2
import psycopg2.extras
import socket
import os
from os.path import abspath, join, pardir, dirname
from qgis.core import QgsDataSourceUri
from .SQLRequet import *
@@ -110,14 +110,9 @@ def load_ui(*args):
return ui_class
def pyperclip():
IPAddr=socket.gethostbyname(socket.gethostname())
dst = abspath(abspath(join(plugin_path(), "CenRa_POSTGIS\\tools\\")))
if IPAddr[0:11] == "100.100.100": #4269
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.0": #01
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.1": #0726
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
dst = dirname(dirname(__file__))+"\\tools\\"
if os.access('N:/',os.R_OK):
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
try:
shutil.copy(src, dst)
except:
@@ -155,7 +150,7 @@ def maj_verif(NAME):
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
+1 -6
View File
@@ -104,12 +104,7 @@ class SICEN(object):
QIcon(":/plugins/sicen/sicen.png"),
u"Ouverture des données SICEN", self.iface.mainWindow())
self.action.setEnabled(False)
IPAddr=socket.gethostbyname(socket.gethostname())
if IPAddr[0:11] == "100.100.100":
self.action.setEnabled(True)
elif IPAddr[0:9] == "192.168.0":
self.action.setEnabled(True)
elif IPAddr[0:9] == "192.168.1":
if os.access('N:/',os.R_OK):
self.action.setEnabled(True)
# connect the action to the run method
self.action.triggered.connect(self.ouverture)
+5 -10
View File
@@ -3,7 +3,7 @@
import configparser
import shutil
import tempfile
import socket
import os
import base64
import psycopg2
import psycopg2.extras
@@ -109,14 +109,9 @@ def load_ui(*args):
return ui_class
def pyperclip():
IPAddr=socket.gethostbyname(socket.gethostname())
dst = abspath(abspath(join(plugin_path(), "CenRa_SICEN\\tools\\")))
if IPAddr[0:11] == "100.100.100": #4269
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.0": #01
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
if IPAddr[0:9] == "192.168.1": #0726
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
dst = dirname(dirname(__file__))+"\\tools\\"
if os.access('N:/',os.R_OK):
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
try:
shutil.copy(src, dst)
except:
@@ -154,7 +149,7 @@ def maj_verif(NAME):
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
+3 -3
View File
@@ -50,9 +50,9 @@
<tags>cenra,sicen</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_FLUX" version="2.6">
<pyqgis_plugin name="CenRa_FLUX" version="2.7">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>2.6</version>
<version>2.7</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_FLUX.zip</file_name>
@@ -61,7 +61,7 @@
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_FLUX.zip</download_url>
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
<create_date>2024-02-06</create_date>
<update_date>2025-04-03</update_date>
<update_date>2025-04-07</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags>cenra,flux</tags>