Téléverser les fichiers vers "CenRa_Metabase"
This commit is contained in:
parent
812412c6f9
commit
b1d2a2f9b5
BIN
CenRa_Metabase/README.md
Normal file
BIN
CenRa_Metabase/README.md
Normal file
Binary file not shown.
90
CenRa_Metabase/issues.py
Normal file
90
CenRa_Metabase/issues.py
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
import os
|
||||||
|
plugin_dir = os.path.dirname(__file__)
|
||||||
|
end_find = plugin_dir.rfind('\\')+1
|
||||||
|
|
||||||
|
NAME = plugin_dir[end_find:]
|
||||||
|
#print(NAME)
|
||||||
|
|
||||||
|
from qgis.gui import *
|
||||||
|
|
||||||
|
from qgis.core import (
|
||||||
|
NULL,
|
||||||
|
QgsApplication,
|
||||||
|
QgsDataSourceUri,
|
||||||
|
QgsProject,
|
||||||
|
QgsProviderConnectionException,
|
||||||
|
QgsProviderRegistry,
|
||||||
|
QgsRasterLayer,
|
||||||
|
QgsSettings,
|
||||||
|
QgsVectorLayer,
|
||||||
|
QgsGeometry,
|
||||||
|
)
|
||||||
|
from qgis.PyQt.QtWidgets import (
|
||||||
|
QDialog,
|
||||||
|
QAction,
|
||||||
|
QDockWidget,
|
||||||
|
QFileDialog,
|
||||||
|
QInputDialog,
|
||||||
|
QMenu,
|
||||||
|
QToolButton,
|
||||||
|
QTableWidget,
|
||||||
|
QTableWidgetItem,
|
||||||
|
)
|
||||||
|
from qgis.utils import iface
|
||||||
|
|
||||||
|
from CenRa_Metabase.resources.i18n import tr
|
||||||
|
|
||||||
|
from CenRa_Metabase.resources.resources import (
|
||||||
|
load_ui,
|
||||||
|
resources_path,
|
||||||
|
send_issues,
|
||||||
|
)
|
||||||
|
|
||||||
|
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
|
||||||
|
|
||||||
|
class CenRa_Issues(QDialog, EDITOR_CLASS):
|
||||||
|
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
_ = parent
|
||||||
|
super().__init__()
|
||||||
|
self.setupUi(self)
|
||||||
|
self.settings = QgsSettings()
|
||||||
|
|
||||||
|
#place connect here
|
||||||
|
self.annuler_button.clicked.connect(self.close)
|
||||||
|
self.ok_button.clicked.connect(self.run_sendissues)
|
||||||
|
|
||||||
|
def run_sendissues(self):
|
||||||
|
text_titre = self.titre_line.text()
|
||||||
|
text_message = self.messages_plain.toPlainText()
|
||||||
|
statu_bug = self.check_bug.isChecked()
|
||||||
|
statu_aide = self.check_aide.isChecked()
|
||||||
|
statu_question = self.check_question.isChecked()
|
||||||
|
statu_amelioration = self.check_amelioration.isChecked()
|
||||||
|
statu_autre = self.check_autre.isChecked()
|
||||||
|
|
||||||
|
statu = []
|
||||||
|
if statu_bug == True : statu = statu + [1]
|
||||||
|
if statu_aide == True : statu = statu + [3]
|
||||||
|
if statu_question == True : statu = statu + [5]
|
||||||
|
if statu_amelioration == True : statu = statu + [2]
|
||||||
|
if statu_autre == True : statu = statu + [6]
|
||||||
|
|
||||||
|
if len(statu) >= 1:
|
||||||
|
import qgis
|
||||||
|
url = qgis.utils.pluginMetadata(NAME,'tracker')
|
||||||
|
print(text_message)
|
||||||
|
send_info = send_issues(url,text_titre,text_message,statu)
|
||||||
|
code = send_info.status_code
|
||||||
|
print(code)
|
||||||
|
else:
|
||||||
|
code = 423
|
||||||
|
if code == 201:
|
||||||
|
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=Qgis.Success, duration=20)
|
||||||
|
self.close()
|
||||||
|
elif code == 422:
|
||||||
|
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=Qgis.Critical, duration=20)
|
||||||
|
elif code == 423:
|
||||||
|
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=Qgis.Critical, duration=20)
|
||||||
|
elif code == 404:
|
||||||
|
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=Qgis.Warning, duration=20)
|
||||||
48
CenRa_Metabase/metadata.txt
Normal file
48
CenRa_Metabase/metadata.txt
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# This file contains metadata for your plugin.
|
||||||
|
|
||||||
|
# This file should be included when you package your plugin.# Mandatory items:
|
||||||
|
|
||||||
|
[general]
|
||||||
|
name=CenRa_Metabase
|
||||||
|
qgisMinimumVersion=3.0
|
||||||
|
description=CenRa_Metabase
|
||||||
|
version=1.0
|
||||||
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
|
about=Permet de saisire et de visualisé les information lier à la metadonné d'une couche ce trouvent sur PostgreSQL
|
||||||
|
|
||||||
|
repository=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS
|
||||||
|
homepage=https://plateformesig.cenra-outils.org/
|
||||||
|
tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
||||||
|
# End of mandatory metadata
|
||||||
|
|
||||||
|
# Recommended items:
|
||||||
|
|
||||||
|
hasProcessingProvider=no
|
||||||
|
# Uncomment the following line and add your changelog:
|
||||||
|
# changelog=
|
||||||
|
|
||||||
|
# Tags are comma separated with spaces allowed
|
||||||
|
tags=python
|
||||||
|
|
||||||
|
|
||||||
|
category=Plugins
|
||||||
|
icon=icon.png
|
||||||
|
# experimental flag
|
||||||
|
experimental=False
|
||||||
|
|
||||||
|
# deprecated flag (applies to the whole plugin, not just a single version)
|
||||||
|
deprecated=False
|
||||||
|
|
||||||
|
# Since QGIS 3.8, a comma separated list of plugins to be installed
|
||||||
|
# (or upgraded) can be specified.
|
||||||
|
# Check the documentation for more information.
|
||||||
|
# plugin_dependencies=
|
||||||
|
|
||||||
|
Category of the plugin: Raster, Vector, Database or Web
|
||||||
|
# category=cenra,database,metadata
|
||||||
|
|
||||||
|
# If the plugin can run on QGIS Server.
|
||||||
|
server=False
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user