flake8 sicen
This commit is contained in:
parent
e503423e49
commit
ca1d895eb1
@ -22,6 +22,7 @@
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
def classFactory(iface):
|
||||
# load SICEN class from file SICEN
|
||||
from .sicen import SICEN
|
||||
|
||||
@ -5,10 +5,9 @@
|
||||
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
try:
|
||||
from PyQt5 import QtCore
|
||||
except:
|
||||
from PyQt6 import QtCore
|
||||
|
||||
from qgis.PyQt import QtCore
|
||||
|
||||
qt_resource_data = b"\
|
||||
\x00\x00\x0d\x89\
|
||||
\x89\
|
||||
@ -558,10 +557,13 @@ else:
|
||||
rcc_version = 2
|
||||
qt_resource_struct = qt_resource_struct_v2
|
||||
|
||||
|
||||
def qInitResources():
|
||||
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||
|
||||
|
||||
def qCleanupResources():
|
||||
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||
|
||||
|
||||
qInitResources()
|
||||
|
||||
@ -1,61 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
/***************************************************************************
|
||||
SICEN
|
||||
A QGIS plugin
|
||||
Filtre sur données SICEN
|
||||
-------------------
|
||||
begin : 2014-10-17
|
||||
copyright : (C) 2014 by Guillaume COSTES (CENRA)
|
||||
email : guillaume.costes@espaces-naturels.fr
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
"""
|
||||
"""from __future__ import absolute_import
|
||||
# Import the PyQt and QGIS libraries
|
||||
from builtins import str
|
||||
from builtins import object
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from qgis.core import *
|
||||
from qgis.gui import *
|
||||
from qgis.utils import iface"""
|
||||
|
||||
from builtins import str
|
||||
from builtins import object
|
||||
import os
|
||||
try:
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
except:
|
||||
from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
from qgis.PyQt import uic
|
||||
from qgis.core import *
|
||||
from qgis.core import QgsDataSourceUri, QgsWkbTypes, QgsLayerTreeGroup, QgsLayerTreeLayer
|
||||
from qgis.PyQt.QtGui import QFont
|
||||
from qgis.PyQt.QtWidgets import QMenu, QAction, QDialog, QDialogButtonBox, QLabel, QApplication, QTabWidget, QWidget, QGroupBox, QGridLayout, QComboBox, QCheckBox, QCalendarWidget, QToolBox, QFrame, QLineEdit, QSizePolicy, QFileDialog #Modifié
|
||||
|
||||
# from qgis.PyQt import uic
|
||||
from qgis.core import QgsDataSourceUri, QgsLayerTreeLayer, QgsProject, QgsVectorLayer
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.PyQt.QtWidgets import QMenu, QAction, QFileDialog
|
||||
from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication, qVersion
|
||||
|
||||
# Initialize Qt resources from file resources.py
|
||||
from . import resources_rc
|
||||
# Import the code for the dialog
|
||||
from .sicendialog import SICENDialog
|
||||
|
||||
from .tools.resources import maj_verif,pyperclip
|
||||
pyperclip()
|
||||
try:
|
||||
from .tools.PythonSQL import login_base
|
||||
except:
|
||||
print('Pas de fichier PythonSQL')
|
||||
import os.path
|
||||
import qgis
|
||||
import datetime
|
||||
@ -63,11 +22,19 @@ import csv
|
||||
|
||||
from .forms.about_form import AboutDialog
|
||||
|
||||
import psycopg2
|
||||
import psycopg2.extras
|
||||
import base64
|
||||
# import psycopg2
|
||||
# import psycopg2.extras
|
||||
# import base64
|
||||
import socket
|
||||
import os
|
||||
|
||||
from .tools.resources import maj_verif, pyperclip
|
||||
pyperclip()
|
||||
try:
|
||||
from .tools.PythonSQL import login_base
|
||||
except ValueError:
|
||||
print('Pas de fichier PythonSQL')
|
||||
|
||||
# import sys
|
||||
|
||||
|
||||
@ -105,7 +72,7 @@ class SICEN(object):
|
||||
self.toolBar = self.iface.addToolBar("SICEN")
|
||||
self.toolBar.setObjectName("SICEN")
|
||||
|
||||
## Create action that will start plugin configuration
|
||||
# Create action that will start plugin configuration
|
||||
self.action = QAction(
|
||||
QIcon(":/plugins/sicen/sicen.png"),
|
||||
u"Ouverture des données SICEN", self.iface.mainWindow())
|
||||
@ -119,7 +86,7 @@ class SICEN(object):
|
||||
self.toolBar.addAction(self.action)
|
||||
self.iface.addPluginToMenu(u"SICEN", self.action)
|
||||
|
||||
## Create action that will start plugin configuration
|
||||
# Create action that will start plugin configuration
|
||||
self.action = QAction(
|
||||
QIcon(":/plugins/sicen/sicen_export.png"),
|
||||
u"Export liste d'espèces", self.iface.mainWindow())
|
||||
@ -175,7 +142,7 @@ class SICEN(object):
|
||||
cur = account[7]
|
||||
con = account[8]
|
||||
|
||||
## Creation des listes deroulantes
|
||||
# Creation des listes deroulantes
|
||||
# Listing de valeur des champs
|
||||
SQL_observateur = u"""SELECT DISTINCT nom || '_' || prenom as nom FROM md.personne ORDER BY nom"""
|
||||
SQL_nom_com = u"""SELECT DISTINCT nom FROM saisie.commune ORDER BY nom"""
|
||||
@ -201,14 +168,14 @@ class SICEN(object):
|
||||
|
||||
con.close()
|
||||
|
||||
|
||||
# Ajout des items dans les combobox
|
||||
self.dlg.observateur_1.clear()
|
||||
i = 0
|
||||
while i < len(list_observateur):
|
||||
self.dlg.observateur_1.addItems(list_observateur[i])
|
||||
i = i + 1
|
||||
self.dlg.observateur_1.setCurrentIndex(-1) # Pour ne pas commencer la liste au premier item
|
||||
# Pour ne pas commencer la liste au premier item
|
||||
self.dlg.observateur_1.setCurrentIndex(-1)
|
||||
|
||||
self.dlg.observateur_2.clear()
|
||||
i = 0
|
||||
@ -496,7 +463,6 @@ class SICEN(object):
|
||||
else:
|
||||
sql_UICN = ''
|
||||
|
||||
|
||||
if self.dlg.PATRIMONIALITE.isChecked() == 1:
|
||||
sql_patrimonialite = """"patrimonialite" IS NOT NULL """
|
||||
else:
|
||||
@ -542,7 +508,6 @@ class SICEN(object):
|
||||
else:
|
||||
sql_patri74 = ''
|
||||
|
||||
|
||||
if self.dlg.ZNIEFF.isChecked() == 1:
|
||||
sql_znieff = """"znieff" IS NOT NULL """
|
||||
else:
|
||||
@ -573,7 +538,7 @@ class SICEN(object):
|
||||
else:
|
||||
sql_pr = ''
|
||||
|
||||
reqwhere_pat = sql_lrd01 + 'OR' + sql_lrd07 + 'OR' + sql_lrd26 + 'OR' + sql_lrd38 + 'OR' + sql_lrd42 + 'OR' + sql_lrd69 + 'OR' + sql_lrd73 + 'OR' + sql_lrd74 + 'OR' + sql_lre + 'OR' + sql_LRN_Flore + 'OR' + sql_LRN_Oiseaux + 'OR' + sql_LRN_Ortho + 'OR' + sql_LRN_Autre + 'OR' + sql_LRR_Flore + 'OR' + sql_LRR_Oiseaux + 'OR' + sql_LRR_Autre + 'OR' + sql_UICN + 'OR' + sql_pd38 + 'OR' + sql_pd42 + 'OR' + sql_pn + 'OR' + sql_pr + 'OR' + sql_dh_an2 + 'OR' + sql_patri01 + 'OR' + sql_patri07 + 'OR' + sql_patri26 + 'OR' + sql_patri38 + 'OR' + sql_patri42 + 'OR' + sql_patri69 + 'OR' + sql_patri73 + 'OR' + sql_patri74 + 'OR' + sql_patrimonialite
|
||||
reqwhere_pat = sql_lrd01 + 'OR' + sql_lrd07 + 'OR' + sql_lrd26 + 'OR' + sql_lrd38 + 'OR' + sql_lrd42 + 'OR' + sql_lrd69 + 'OR' + sql_lrd73 + 'OR' + sql_lrd74 + 'OR' + sql_lre + 'OR' + sql_LRN_Flore + 'OR' + sql_LRN_Oiseaux + 'OR' + sql_LRN_Ortho + 'OR' + sql_LRN_Autre + 'OR' + sql_LRR_Flore + 'OR' + sql_LRR_Oiseaux + 'OR' + sql_LRR_Autre + 'OR' + sql_UICN + 'OR' + sql_pd38 + 'OR' + sql_pd42 + 'OR' + sql_pn + 'OR' + sql_pr + 'OR' + sql_znieff + 'OR' + sql_dh_an2 + 'OR' + sql_patri01 + 'OR' + sql_patri07 + 'OR' + sql_patri26 + 'OR' + sql_patri38 + 'OR' + sql_patri42 + 'OR' + sql_patri69 + 'OR' + sql_patri73 + 'OR' + sql_patri74 + 'OR' + sql_patrimonialite
|
||||
|
||||
while reqwhere_pat.find('OROR') != - 1:
|
||||
reqwhere_pat = reqwhere_pat.replace('OROR', 'OR')
|
||||
@ -586,9 +551,9 @@ class SICEN(object):
|
||||
if self.dlg.bouton_geom.isChecked() == 1:
|
||||
|
||||
layer = self.iface.activeLayer()
|
||||
if layer == None :
|
||||
if layer is None:
|
||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=1, duration=5)
|
||||
|
||||
else:
|
||||
selection = layer.selectedFeatures()
|
||||
@ -620,14 +585,14 @@ class SICEN(object):
|
||||
while reqwhere_final[:3] == 'AND':
|
||||
reqwhere_final = reqwhere_final[3:]
|
||||
|
||||
## Affichage des tables
|
||||
# Affichage des tables
|
||||
table_name = 'observations'
|
||||
|
||||
uri = QgsDataSourceUri()
|
||||
uri.setConnection(host, port, dbname, user, mdp)
|
||||
|
||||
if self.dlg.centroide.isChecked() == 1:
|
||||
### Centroide
|
||||
# Centroide
|
||||
if reqwhere_final.find('()') != - 1:
|
||||
reqwhere_final = ''
|
||||
print(reqwhere_final)
|
||||
@ -660,9 +625,9 @@ class SICEN(object):
|
||||
# groups = toc.
|
||||
# groups = toc.groups()
|
||||
# index = groups.index(nomgroupe)
|
||||
index = 1
|
||||
# index = 1
|
||||
|
||||
### Polygone
|
||||
# Polygone
|
||||
reqwhere_final_poly = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POLYGON%'" + ')'
|
||||
if reqwhere_final_poly.find('()') != - 1:
|
||||
reqwhere_final_poly = "(GeometryType(geometrie) LIKE '%POLYGON%')"
|
||||
@ -681,7 +646,7 @@ class SICEN(object):
|
||||
# groupe.addLayer(layer_poly)
|
||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_poly))
|
||||
|
||||
### Point
|
||||
# Point
|
||||
reqwhere_final_point = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POINT%'" + ')'
|
||||
if reqwhere_final_point.find('()') != - 1:
|
||||
reqwhere_final_point = "(GeometryType(geometrie) LIKE '%POINT%')"
|
||||
@ -700,7 +665,7 @@ class SICEN(object):
|
||||
# groupe.addLayer(layer_point)
|
||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_point))
|
||||
|
||||
### Ligne
|
||||
# Ligne
|
||||
reqwhere_final_ligne = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%LINE%'" + ')'
|
||||
if reqwhere_final_ligne.find('()') != - 1:
|
||||
reqwhere_final_ligne = "(GeometryType(geometrie) LIKE '%LINE%')"
|
||||
@ -723,17 +688,16 @@ class SICEN(object):
|
||||
# legende.setGroupExpanded (index, True)
|
||||
|
||||
# self.iface.messageBar().pushMessage(u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=QgsMessageBar.INFO, duration=10)
|
||||
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=Qgis.Success, duration=4)
|
||||
|
||||
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=0, duration=4)
|
||||
|
||||
elif layer.selectedFeatureCount() == 0:
|
||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner au moins un polygone !", level=QgsMessageBar.WARNING, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner au moins un polygone !", level=Qgis.Warning, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner au moins un polygone !", level=1, duration=5)
|
||||
reqwhere_geom = ''
|
||||
|
||||
else:
|
||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner qu'un seul polygone !", level=QgsMessageBar.WARNING, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous ne devez sélectionner qu'un seul polygone !", level=Qgis.Warning, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous ne devez sélectionner qu'un seul polygone !", level=1, duration=5)
|
||||
reqwhere_geom = ''
|
||||
else:
|
||||
# Requete finale
|
||||
@ -753,13 +717,13 @@ class SICEN(object):
|
||||
while reqwhere_final[:3] == 'AND':
|
||||
reqwhere_final = reqwhere_final[3:]
|
||||
|
||||
## Affichage des tables
|
||||
# Affichage des tables
|
||||
table_name = 'observations'
|
||||
|
||||
uri = QgsDataSourceUri()
|
||||
uri.setConnection(host, port, dbname, user, mdp)
|
||||
|
||||
## Centroide
|
||||
# Centroide
|
||||
if self.dlg.centroide.isChecked() == 1:
|
||||
if reqwhere_final.find('()') != - 1:
|
||||
reqwhere_final = ''
|
||||
@ -792,9 +756,9 @@ class SICEN(object):
|
||||
# groups = toc.
|
||||
# groups = toc.groups()
|
||||
# index = groups.index(nomgroupe)
|
||||
index = 1
|
||||
# index = 1
|
||||
|
||||
### Polygone
|
||||
# Polygone
|
||||
reqwhere_final_poly = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POLYGON%'" + ')'
|
||||
if reqwhere_final_poly.find('()') != - 1:
|
||||
reqwhere_final_poly = "(GeometryType(geometrie) LIKE '%POLYGON%')"
|
||||
@ -813,7 +777,7 @@ class SICEN(object):
|
||||
# groupe.addLayer(layer_poly)
|
||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_poly))
|
||||
|
||||
### Point
|
||||
# Point
|
||||
reqwhere_final_point = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POINT%'" + ')'
|
||||
if reqwhere_final_point.find('()') != - 1:
|
||||
reqwhere_final_point = "(GeometryType(geometrie) LIKE '%POINT%')"
|
||||
@ -832,7 +796,7 @@ class SICEN(object):
|
||||
# groupe.addLayer(layer_point)
|
||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_point))
|
||||
|
||||
### Ligne
|
||||
# Ligne
|
||||
reqwhere_final_ligne = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%LINE%'" + ')'
|
||||
if reqwhere_final_ligne.find('()') != - 1:
|
||||
reqwhere_final_ligne = "(GeometryType(geometrie) LIKE '%LINE%')"
|
||||
@ -855,7 +819,7 @@ class SICEN(object):
|
||||
# legende.setGroupExpanded (index, True)
|
||||
|
||||
# self.iface.messageBar().pushMessage(u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=QgsMessageBar.INFO, duration=10)
|
||||
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=Qgis.Success, duration=10)
|
||||
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=0, duration=10)
|
||||
|
||||
pass
|
||||
|
||||
@ -863,9 +827,9 @@ class SICEN(object):
|
||||
|
||||
layer = self.iface.activeLayer()
|
||||
|
||||
if layer == None :
|
||||
if layer is None:
|
||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=1, duration=5)
|
||||
|
||||
else:
|
||||
selection = layer.selectedFeatures()
|
||||
@ -877,13 +841,13 @@ class SICEN(object):
|
||||
buffer = '100'
|
||||
|
||||
account = login_base("account")
|
||||
user = account[0]
|
||||
mdp = account[1]
|
||||
host = account[2]
|
||||
port = account[3]
|
||||
dbname = account[4]
|
||||
# user = account[0]
|
||||
# mdp = account[1]
|
||||
# host = account[2]
|
||||
# port = account[3]
|
||||
# dbname = account[4]
|
||||
cur = account[7]
|
||||
con = account[8]
|
||||
# con = account[8]
|
||||
|
||||
SQL_list_sp = u"""SELECT DISTINCT classe::text,ordre::text,nom_complet::text,split_part(nom_vern::text,', ',1) as nom_vern,cd_ref::text as cd_ref,max(COALESCE(date_obs, date_debut_obs))::text AS derniere_obs FROM _agregation_ra.observations_table WHERE ST_intersects(geometrie,ST_Buffer(ST_geomFromText('""" + poly + "',2154), " + buffer + " ))GROUP BY classe::text, ordre::text, nom_complet::text, nom_vern::text, cd_ref::text ORDER BY nom_complet::text"""
|
||||
cur.execute(SQL_list_sp)
|
||||
@ -893,44 +857,51 @@ class SICEN(object):
|
||||
file = open(chemin_fichier, 'w', newline='', encoding='utf-8')
|
||||
# file.write('\ufeff'.encode('utf8')) # BOM (optionel...Permet a Excel d'ouvrir proprement le fichier en UTF-8)
|
||||
file.write('\ufeff')
|
||||
writer = csv.writer(file, delimiter = ';') # délimiteur ';' pour faciliter l'ouverture avec Excel
|
||||
writer.writerow(['Classe', 'Ordre', 'Nom Complet', 'Nom Vernaculaire','cd_ref', 'Date Derniere Observation']) # Création des entêtes
|
||||
# délimiteur ';' pour faciliter l'ouverture avec Excel
|
||||
writer = csv.writer(file, delimiter=';')
|
||||
# Création des entêtes
|
||||
writer.writerow(['Classe', 'Ordre', 'Nom Complet', 'Nom Vernaculaire', 'cd_ref', 'Date Derniere Observation'])
|
||||
|
||||
for row in data_sp : # Boucle d'écriture ligne par ligne dans le csv
|
||||
# Boucle d'écriture ligne par ligne dans le csv
|
||||
for row in data_sp:
|
||||
# print(1)
|
||||
list_sp = []
|
||||
if row[0] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
if row[0] is None:
|
||||
row0 = str(row[0])
|
||||
row0 = ''
|
||||
else:
|
||||
row0 = row[0]
|
||||
# print(row0)
|
||||
list_sp.append(row0)
|
||||
if row[1] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
if row[1] is None:
|
||||
row1 = str(row[1])
|
||||
row1 = ''
|
||||
else:
|
||||
row1 = row[1]
|
||||
list_sp.append(row1)
|
||||
if row[2] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
if row[2] is None:
|
||||
row2 = str(row[2])
|
||||
row2 = ''
|
||||
else:
|
||||
row2 = row[2]
|
||||
list_sp.append(row2)
|
||||
if row[3] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||
if row[3] is None:
|
||||
row3 = str(row[3])
|
||||
row3 = ''
|
||||
else:
|
||||
row3 = row[3]
|
||||
list_sp.append(row3)
|
||||
if row[4] == None :
|
||||
if row[4] is None:
|
||||
row4 = str(row[4])
|
||||
row4 = ''
|
||||
else:
|
||||
row4 = row[4]
|
||||
list_sp.append(row4)
|
||||
if row[5] == None :
|
||||
if row[5] is None:
|
||||
row5 = str(row[5])
|
||||
row5 = ''
|
||||
else:
|
||||
@ -941,12 +912,12 @@ class SICEN(object):
|
||||
|
||||
file.close()
|
||||
# self.iface.messageBar().pushMessage(u"Export réussi dans " + chemin_fichier , level=QgsMessageBar.INFO, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Export réussi dans " + chemin_fichier, level=Qgis.Success, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Export réussi dans " + chemin_fichier, level=0, duration=5)
|
||||
|
||||
elif (layer.selectedFeatureCount() == 0):
|
||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner au moins un polygone !", level=QgsMessageBar.WARNING, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner au moins un polygone !", level=Qgis.Warning, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner au moins un polygone !", level=1, duration=5)
|
||||
|
||||
else:
|
||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner qu'un seul polygone !", level=QgsMessageBar.WARNING, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous ne devez sélectionner qu'un seul polygone !", level=Qgis.Warning, duration=5)
|
||||
self.iface.messageBar().pushMessage("Ooops", u"Vous ne devez sélectionner qu'un seul polygone !", level=1, duration=5)
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
***************************************************************************/
|
||||
"""
|
||||
|
||||
from qgis.PyQt import QtCore, QtGui
|
||||
from qgis.PyQt.QtWidgets import QAction, QDialog
|
||||
# from qgis.PyQt import QtCore, QtGui
|
||||
from qgis.PyQt.QtWidgets import QDialog
|
||||
from .ui_sicen import Ui_SICEN
|
||||
# create the dialog for zoom to point
|
||||
|
||||
|
||||
@ -8,9 +8,10 @@
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from builtins import object
|
||||
from qgis.PyQt import QtCore, QtGui
|
||||
from qgis.PyQt import QtCore
|
||||
from qgis.PyQt.QtGui import QFont
|
||||
from qgis.PyQt.QtWidgets import QAction, QDialog, QDialogButtonBox, QLabel, QApplication, QTabWidget, QWidget, QGroupBox, QGridLayout, QComboBox, QCheckBox, QCalendarWidget, QToolBox, QFrame, QLineEdit, QSizePolicy #Modifié
|
||||
# Modifié
|
||||
from qgis.PyQt.QtWidgets import QDialogButtonBox, QLabel, QApplication, QTabWidget, QWidget, QGroupBox, QGridLayout, QComboBox, QCheckBox, QCalendarWidget, QToolBox, QFrame, QLineEdit, QSizePolicy
|
||||
|
||||
|
||||
try:
|
||||
@ -21,12 +22,14 @@ except AttributeError:
|
||||
|
||||
try:
|
||||
_encoding = QApplication.UnicodeUTF8
|
||||
|
||||
def _translate(context, text, disambig):
|
||||
return QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QApplication.translate(context, text, disambig)
|
||||
|
||||
|
||||
class Ui_SICEN(object):
|
||||
def setupUi(self, SICEN):
|
||||
SICEN.setObjectName(_fromUtf8("SICEN"))
|
||||
@ -681,7 +684,8 @@ class Ui_SICEN(object):
|
||||
self.Emprise.setCurrentIndex(0)
|
||||
self.protections.setCurrentIndex(0)
|
||||
self.buttonBox.accepted.connect(SICEN.accept)
|
||||
self.buttonBox.rejected.connect(SICEN.reject) #Modifié
|
||||
# Modifié
|
||||
self.buttonBox.rejected.connect(SICEN.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(SICEN)
|
||||
|
||||
def retranslateUi(self, SICEN):
|
||||
@ -753,4 +757,3 @@ class Ui_SICEN(object):
|
||||
self.label_11.setText(_translate("SICEN", "4.", None))
|
||||
self.Emprise.setTabText(self.Emprise.indexOf(self.tab_4), _translate("SICEN", "Filtre par Emprise", None))
|
||||
self.centroide.setText(_translate("SICEN", "Utiliser les centroïdes pour les observations autres que ponctuelles", None))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user