forked from CEN-RA/Plugin_QGIS
Optimisation pour TT
This commit is contained in:
parent
bc538524fb
commit
c809c12c9f
@ -4,7 +4,7 @@ import configparser
|
|||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
import base64
|
||||||
import socket
|
import os
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
@ -109,14 +109,9 @@ def load_ui(*args):
|
|||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_AUTOMAP\\tools\\")))
|
if os.access('N:/',os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/StyleLayer.py'
|
||||||
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'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -70,11 +70,7 @@ class PgCopie:
|
|||||||
self.copie_editor.triggered.connect(self.open_editor)
|
self.copie_editor.triggered.connect(self.open_editor)
|
||||||
self.copie_editor.setEnabled(False)
|
self.copie_editor.setEnabled(False)
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
IPAddr=socket.gethostbyname(socket.gethostname())
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/',os.R_OK):
|
||||||
self.copie_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.copie_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.copie_editor.setEnabled(True)
|
self.copie_editor.setEnabled(True)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import tempfile
|
|||||||
import base64
|
import base64
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
import socket
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
@ -109,14 +109,9 @@ def load_ui(*args):
|
|||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_COPIE\\tools\\")))
|
if os.access('N:/',os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
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'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -70,12 +70,7 @@ class PgFlux:
|
|||||||
self.toolBar.addAction(self.flux_editor)
|
self.toolBar.addAction(self.flux_editor)
|
||||||
self.flux_editor.triggered.connect(self.open_editor)
|
self.flux_editor.triggered.connect(self.open_editor)
|
||||||
self.flux_editor.setEnabled(False)
|
self.flux_editor.setEnabled(False)
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
if os.access('N:/',os.R_OK):
|
||||||
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":
|
|
||||||
self.flux_editor.setEnabled(True)
|
self.flux_editor.setEnabled(True)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import socket
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
|
|
||||||
@ -78,14 +78,9 @@ def plugin_test_data_path(*args, copy=False):
|
|||||||
return path
|
return path
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_FLUX\\tools\\")))
|
if os.access('N:/',os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
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'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import socket
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
from qgis.PyQt.QtWidgets import QApplication
|
from qgis.PyQt.QtWidgets import QApplication
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
@ -93,14 +93,9 @@ def resources_path(*args):
|
|||||||
return path
|
return path
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_METABASE\\tools\\")))
|
if os.access('N:/',os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
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'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -80,11 +80,7 @@ class PgPostgis:
|
|||||||
self.postgis_creator.triggered.connect(self.open_creator)
|
self.postgis_creator.triggered.connect(self.open_creator)
|
||||||
|
|
||||||
self.postgis_creator.setEnabled(False)
|
self.postgis_creator.setEnabled(False)
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/',os.R_OK):
|
||||||
self.postgis_creator.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.postgis_creator.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.postgis_creator.setEnabled(True)
|
self.postgis_creator.setEnabled(True)
|
||||||
|
|
||||||
if not self.action_editor:
|
if not self.action_editor:
|
||||||
@ -95,11 +91,7 @@ class PgPostgis:
|
|||||||
self.postgis_editor.triggered.connect(self.open_editor)
|
self.postgis_editor.triggered.connect(self.open_editor)
|
||||||
|
|
||||||
self.postgis_editor.setEnabled(False)
|
self.postgis_editor.setEnabled(False)
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/',os.R_OK):
|
||||||
self.postgis_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.postgis_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.postgis_editor.setEnabled(True)
|
self.postgis_editor.setEnabled(True)
|
||||||
|
|
||||||
if not self.action_rename:
|
if not self.action_rename:
|
||||||
@ -119,11 +111,7 @@ class PgPostgis:
|
|||||||
self.postgis_rename.setVisible(0)
|
self.postgis_rename.setVisible(0)
|
||||||
|
|
||||||
self.postgis_rename.setEnabled(False)
|
self.postgis_rename.setEnabled(False)
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/',os.R_OK):
|
||||||
self.postgis_rename.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.postgis_rename.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.postgis_rename.setEnabled(True)
|
self.postgis_rename.setEnabled(True)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import tempfile
|
|||||||
import base64
|
import base64
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
import socket
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
from qgis.core import QgsDataSourceUri
|
from qgis.core import QgsDataSourceUri
|
||||||
from .SQLRequet import *
|
from .SQLRequet import *
|
||||||
@ -110,14 +110,9 @@ def load_ui(*args):
|
|||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_POSTGIS\\tools\\")))
|
if os.access('N:/',os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
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'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -104,12 +104,7 @@ class SICEN(object):
|
|||||||
QIcon(":/plugins/sicen/sicen.png"),
|
QIcon(":/plugins/sicen/sicen.png"),
|
||||||
u"Ouverture des données SICEN", self.iface.mainWindow())
|
u"Ouverture des données SICEN", self.iface.mainWindow())
|
||||||
self.action.setEnabled(False)
|
self.action.setEnabled(False)
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
if os.access('N:/',os.R_OK):
|
||||||
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":
|
|
||||||
self.action.setEnabled(True)
|
self.action.setEnabled(True)
|
||||||
# connect the action to the run method
|
# connect the action to the run method
|
||||||
self.action.triggered.connect(self.ouverture)
|
self.action.triggered.connect(self.ouverture)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import socket
|
import os
|
||||||
import base64
|
import base64
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
@ -109,14 +109,9 @@ def load_ui(*args):
|
|||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_SICEN\\tools\\")))
|
if os.access('N:/',os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
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'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user