Commit b8ca77ed authored by Commandre Benjamin's avatar Commandre Benjamin
Browse files

Upgrade to Python3

1 merge request!1Develop
Showing with 497 additions and 543 deletions
+497 -543
......@@ -18,7 +18,7 @@
# along with PHYMOBAT 3.0. If not, see <http://www.gnu.org/licenses/>.
import os, sys, glob, re, shutil, time
import math, subprocess, json, urllib2
import math, subprocess, json, urllib # urllib2
import tarfile, zipfile
try :
......@@ -26,10 +26,10 @@ try :
except :
from osgeo import ogr
import UserDict
# import UserDict
import numpy as np
from lxml import etree
from collections import defaultdict
from collections import defaultdict, UserDict
from RasterSat_by_date import RasterSat_by_date
......@@ -104,7 +104,7 @@ class Archive():
_few_list_archive = np.array(few_list_archive)
# Verify list informations
if _few_list_archive.ndim < 2:
print 'Few information in the list'
print ('Few information in the list')
else:
self.list_archive = few_list_archive
......@@ -208,7 +208,7 @@ class Archive():
data_source = driver.Open(utm_outfile, 0)
if data_source is None:
print 'Could not open file'
print ('Could not open file')
sys.exit(1)
shp_ogr = data_source.GetLayer()
......@@ -235,21 +235,21 @@ class Archive():
"""
# Loop on the years
print "Images availables"
print ("Images availables")
for year in self._list_year:
first_date = year.split(',')[0]
# Tricks to put whether a year or a date (year-month-day)
try:
end_date = year.split(',')[1]
print "=============== " + str(first_date) + " to " + str(end_date) + " ==============="
print ("=============== " + str(first_date) + " to " + str(end_date) + " ===============")
self.url = self.server + '/' + self.resto + '/api/collections/' + self._captor + '/search.json?lang=fr&_pretty=true&completionDate=' + str(end_date) + '&box=' + self.coord_box_dd() + '&maxRecord=500&startDate=' + str(first_date)
except IndexError:
print "=============== " + str(first_date) + " ==============="
print ("=============== " + str(first_date) + " ===============" )
self.url = self.server + '/' + self.resto + '/api/collections/' + self._captor + '/search.json?lang=fr&_pretty=true&q=' + str(year) + '&box=' + self.coord_box_dd() + '&maxRecord=500'
print self.url
print (self.url)
# Link to connect in the database JSON of the Theia plateform
# self.url = r'https://theia.cnes.fr/resto/api/collections/' + self._captor + '/search.json?lang=fr&_pretty=true&q=' + str(year) + '&box=' + self.coord_box_dd() + '&maxRecord=500'
# Temporary link
......@@ -270,8 +270,8 @@ class Archive():
try :
request_headers = {"User-Agent": "Firefox/48.0"}
req = urllib2.Request(str(self.url), headers = request_headers) # Connexion in the database
data = urllib2.urlopen(req).read() # Read in the database
req = urllib.Request(str(self.url), headers = request_headers) # Connexion in the database
data = urllib.urlopen(req).read() # Read in the database
new_data = re.sub("null", "'null'", data) # Remove "null" because Python don't like
new_data = re.sub("false", "False", new_data) # Remove "false" and replace by False (Python know False with a capital letter F)
......@@ -296,10 +296,10 @@ class Archive():
else:
next_ = 0
except:
print "Error connexion or error variable !"
print ("Error connexion or error variable !")
sys.exit(1)
print "There is " + str(len(self.list_archive)) + " images to download !"
print ("There is " + str(len(self.list_archive)) + " images to download !")
def download_auto(self, user_theia, password_theia):
"""
......@@ -343,7 +343,7 @@ class Archive():
elif self.token_type=="text":
token=data_file.readline()
except :
print "Authentification is probably wrong"
print ("Authentification is probably wrong")
sys.exit(-1)
#====================
......@@ -354,24 +354,24 @@ class Archive():
# Download if not exist
if not os.path.exists(self.list_archive[d][1]):
print str(round(100*float(d)/len(self.list_archive),2)) + "%" # Print loading bar
print os.path.split(str(self.list_archive[d][1]))[1]
print (str(round(100*float(d)/len(self.list_archive),2)) + "%") # Print loading bar
print (os.path.split(str(self.list_archive[d][1]))[1])
# get_product='curl -o %s -k -H "Authorization: Bearer %s" https://theia.cnes.fr/resto/collections/Landsat/%s/download/?issuerId=theia'%(curl_proxy,self.list_archive[d][1], token, self.list_archive[d][2])
get_product='curl %s -o %s -k -H "Authorization: Bearer %s" %s/%s/collections/%s/%s/download/?issuerId=theia'%(curl_proxy, self.list_archive[d][1], token, self.server, self.resto, self._captor, self.list_archive[d][2])
print get_product
print (get_product)
os.system(get_product)
os.remove('token.json')
print "100%"
print "END OF DOWNLOAD !"
print ("100%")
print ("END OF DOWNLOAD !" )
def decompress(self):
"""
Function to unpack archives and store informations of the images (date, path, ...)
"""
print "Unpack archives"
print ("Unpack archives")
for annee in self._list_year:
......@@ -379,15 +379,15 @@ class Archive():
# Tricks to put whether a year or a date (year-month-day)
try:
end_date = annee.split(',')[1]
print "=============== " + str(first_date) + " to " + str(end_date) + " ==============="
print ("=============== " + str(first_date) + " to " + str(end_date) + " ===============")
except IndexError:
print "=============== " + str(first_date) + " ==============="
print ("=============== " + str(first_date) + " ===============")
img_in_glob = []
img_in_glob = glob.glob(str(self._folder) + '/'+ str(self._repertory) + '/*gz')
if img_in_glob == []:
print "There isn't tgzfile in the folder"
print ("There isn't tgzfile in the folder")
sys.exit()
else:
# Create a folder "Unpack"
......@@ -406,7 +406,7 @@ class Archive():
if self._captor == 'Landsat':
out_folder_unpack = folder_unpack + '/' + os.path.split(img)[1][:len(os.path.split(img)[1])-4]
if not os.path.exists(out_folder_unpack):
print 'Unpack :'+os.path.split(img)[1]
print ('Unpack :'+os.path.split(img)[1])
tfile = tarfile.open(img, 'r:gz')
tfile.extractall(str(folder_unpack))
......@@ -432,7 +432,7 @@ class Archive():
zip_folder = zip_img[0].split('/')[0]
out_folder_unpack = folder_unpack + '/' + zip_folder
print 'Unpack :' + os.path.split(zip_folder)[1]
print ('Unpack :' + os.path.split(zip_folder)[1])
extraction_img = []
for e in extent_img:
z_out = [f for f in zip_img if e in f][0]
......@@ -464,5 +464,5 @@ class Archive():
if not di in self.single_date:
self.single_date.append(di)
print "End of unpack archives"
print ("End of unpack archives")
This diff is collapsed.
......@@ -156,10 +156,10 @@ class Precision_moba():
print('')
print('Accuracy : %f, Kappa : %f, Recall : %f, Precision : %f, F_score : %f' % (accur, kappa, recall, pr, f_scor))
print('')
print all_pr
print (all_pr)
print('')
print('Confusion matrix :')
print cm
print (cm)
f.close()
......
......@@ -490,7 +490,7 @@ class Processing():
i_s = i_s + 1
# Method to stop the processus if there is not found a valid threshold
if i_s != 20:
print 'Problem in the sample processing !!!'
print ('Problem in the sample processing !!!')
sys.exit(1)
def i_sample_rf(self):
......
......@@ -53,7 +53,7 @@ class RasterSat_by_date():
self._one_date = one_date
# Verify list of list of str
if one_date == []:
print "Enter dates to mosaic images like [[str(year), str(month), str(day)], [str(year), str(month), str(day)], ...]"
print ("Enter dates to mosaic images like [[str(year), str(month), str(day)], [str(year), str(month), str(day)], ...]")
sys.exit(1)
else:
self._one_date = one_date
......@@ -101,10 +101,10 @@ class RasterSat_by_date():
if vrt_translate == 'vrt':
# Verify input data
if type(src_data) is not np.ndarray and type(src_data) is not list:
print 'VRT file ! The data source should be composed of several data. A list minimal of 2 dimensions'
print ('VRT file ! The data source should be composed of several data. A list minimal of 2 dimensions')
sys.exit(1)
print 'Build VRT file'
print ('Build VRT file')
if not os.path.exists(dst_data):
process_tocall = ['gdalbuildvrt', '-srcnodata', '-10000', dst_data]
......@@ -117,10 +117,10 @@ class RasterSat_by_date():
try :
src_data = str(src_data)
except:# if type(src_data) is not str:
print 'Geotiff file ! The data source should be composed of path file. A character string !'
print ('Geotiff file ! The data source should be composed of path file. A character string !')
sys.exit(1)
print 'Build Geotiff file'
print ('Build Geotiff file')
if not os.path.exists(dst_data):
process_tocall = ['gdal_translate', '-a_nodata', '-10000', src_data, dst_data]
......@@ -192,7 +192,7 @@ class RasterSat_by_date():
gdal.AllRegister()
# Loading input raster
print 'Loading input raster :', os.path.split(str(img))[1][:-4]
print ('Loading input raster :', os.path.split(str(img))[1][:-4])
in_ds = gdal.Open(str(img), gdal.GA_ReadOnly)
# if it doesn't exist
......@@ -254,7 +254,7 @@ class RasterSat_by_date():
mask_spec = np.in1d(data_spec[0], [-10000, math.isnan], invert=True) # ex : array([ True, True, True, True, False, True, True, True, True], dtype=bool) -> False where there is -10000 ou NaN
# Print area account of the pixel size 'info_spec.GetGeoTransform()'
print 'Area = ' + str(float((np.sum(mask_spec) * info_spec.GetGeoTransform()[1] * abs(info_spec.GetGeoTransform()[-1]) )/10000)) + 'ha'
print ('Area = ' + str(float((np.sum(mask_spec) * info_spec.GetGeoTransform()[1] * abs(info_spec.GetGeoTransform()[-1]) )/10000)) + 'ha' )
# Cloud mask
mask_cloud = np.in1d(data_cloud, 0) # This is the same opposite False where there is 0
......@@ -336,7 +336,7 @@ class RasterSat_by_date():
# Create outfile
self.out_ds = driver.Create(str(out_raster), in_ds.RasterXSize, in_ds.RasterYSize, nbband, gdal.GDT_Float32)
if self.out_ds is None:
print 'Could not create ' + os.path.split(str(out_raster))[1]
print ('Could not create ' + os.path.split(str(out_raster))[1])
sys.exit(1)
# Get extent coordinates and raster resolution
......@@ -363,7 +363,7 @@ class RasterSat_by_date():
return nbband, e
def complete_raster(self, (nbband, e), data):
def complete_raster(self, nbband, e, data):
"""
This function complete the function above :func:`create_raster()`. It
fills the raster table and close the layer.
......@@ -386,7 +386,7 @@ class RasterSat_by_date():
#Incrementation
p = p + 1
print "Copy on the band ", p
print ("Copy on the band ", p)
# Loading spectral band of outfile
out_band = self.out_ds.GetRasterBand(p)
......
......@@ -100,8 +100,8 @@ class Seath():
v[mark].append(np.var(C[mark]))
p[mark].append(1 / float(len(C[mark])))
print "m : ", m
print "v : ", v
print ("m : ", m)
print ("v : ", v)
# Mean, standard deviation and likelihood initialisation phase for 2 classes
m1 = m[0]
......@@ -126,12 +126,12 @@ class Seath():
# Optimal threshold
# Logical condition depending on article figure 2
if ( seuil1[i] > m2[i] and seuil1[i] < m1[i] ) or ( seuil1[i] > m1[i] and seuil1[i] < m2[i] ) :
print "Valid threshold !"
print ("Valid threshold !")
else:
seuil1[i] = ""
if ( seuil2[i] > m2[i] and seuil2[i] < m1[i] ) or ( seuil2[i] > m1[i] and seuil2[i] < m2[i] ) :
print "Valid threshold !"
print ("Valid threshold !")
else:
seuil2[i] = ""
......
......@@ -53,7 +53,7 @@ class Toolbox():
rm_rast = kwargs['rm_rast'] if kwargs.get('rm_rast') else 0
outclip = os.path.split(str(self.imag))[0] + '/Clip_' + os.path.split(str(self.imag))[1]
if not os.path.exists(outclip) or rm_rast == 1:
print 'Raster clip of ' + os.path.split(str(self.imag))[1]
print ('Raster clip of ' + os.path.split(str(self.imag))[1])
# Command to clip a raster with a shapefile by Gdal
process_tocall_clip = ['gdalwarp', '-overwrite', '-dstnodata', '-10000', '-q', '-cutline', self.vect, '-crop_to_cutline', '-of', 'GTiff', self.imag, outclip]
# This is a trick to remove warning with the polygons that touch themselves
......@@ -68,7 +68,7 @@ class Toolbox():
preprocess_tocall = 'ogr2ogr -overwrite ' + vect_2 + ' ' + self.vect + ' -dialect sqlite -sql "SELECT ST_Union(geometry), * FROM ' + \
os.path.basename(self.vect)[:-4] +'"'
os.system(preprocess_tocall)
print 'Raster clip of ' + os.path.split(str(self.imag))[1]
print ('Raster clip of ' + os.path.split(str(self.imag))[1])
process_tocall_clip = ['gdalwarp', '-overwrite', '-dstnodata', '-10000', '-q', '-cutline', vect_2, '-crop_to_cutline', '-of', 'GTiff', self.imag, outclip]
subprocess.call(process_tocall_clip)
for rem in glob.glob(vect_2[:-4] + '*'):
......
......@@ -24,6 +24,7 @@ try :
import ogr, gdal
except :
from osgeo import ogr, gdal
from rasterstats import *
from collections import *
......@@ -80,7 +81,7 @@ class Vector():
outclip = os.path.split(self.vector_used)[0] + '/Clip_' + os.path.split(self.vector_used)[1]
if not os.path.exists(outclip) or self.remove_shp == 1:
print 'Clip of ' + os.path.split(self.vector_used)[1]
print ('Clip of ' + os.path.split(self.vector_used)[1])
# Command to clip a vector with a shapefile by OGR
process_tocall_clip = ['ogr2ogr', '-overwrite', '-skipfailures', outclip, self.vector_used, '-clipsrc', self.vector_cut]
subprocess.call(process_tocall_clip)
......@@ -114,7 +115,7 @@ class Vector():
print('Shapefile closing : ' + self.data_source.GetLayer().GetName())
def zonal_stats(self, (inraster, band), **kwargs):
def zonal_stats(self, inraster, band, **kwargs):
"""
Function to compute the average in every polygons for a raster
because of package ``rasterstats`` in */usr/local/lib/python2.7/dist-packages/rasterstats-0.3.2-py2.7.egg/rasterstats/*
......
......@@ -38,8 +38,8 @@ class Vhrs():
"""
def __init__(self, imag, mp):
"""Create a new 'Texture' instance
"""
Create a new 'Texture' instance
"""
self._imag = imag
......
......@@ -23,21 +23,15 @@
# You should have received a copy of the GNU General Public License
# along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>.
from PyQt5 import QtCore, QtGui
# try:
# _fromUtf8 = QtCore.QString.fromUtf8
# except AttributeError:
def _fromUtf8(s):
return s
from PyQt5 import QtCore, QtGui, QtWidgets
try:
_encoding = QtGui.QApplication.UnicodeUTF8
_encoding = QtWidgets.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
return QtWidgets.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
return QtWidgets.QApplication.translate(context, text, disambig)
class Ui_About(object):
"""
......@@ -46,19 +40,19 @@ class Ui_About(object):
"""
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("A propos de PHYMOBAT"))
Form.setObjectName("A propos de PHYMOBAT")
Form.resize(507, 578)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout = QtWidgets.QGridLayout(Form)
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(Form)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
spacerItem = QtGui.QSpacerItem(193, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
spacerItem = QtWidgets.QSpacerItem(193, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 1, 0, 1, 1)
self.close_newWindow = QtGui.QPushButton(Form)
self.close_newWindow.setObjectName(_fromUtf8("close_newWindow"))
self.close_newWindow = QtWidgets.QPushButton(Form)
self.close_newWindow.setObjectName("close_newWindow")
self.gridLayout.addWidget(self.close_newWindow, 1, 1, 1, 1)
spacerItem1 = QtGui.QSpacerItem(193, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
spacerItem1 = QtWidgets.QSpacerItem(193, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
self.retranslateUi(Form)
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,21 +7,15 @@
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui
# try:
# _fromUtf8 = QtCore.QString.fromUtf8
# except AttributeError:
def _fromUtf8(s):
return s
from PyQt5 import QtCore, QtWidgets
try:
_encoding = QtGui.QApplication.UnicodeUTF8
_encoding = QtWidgets.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
return QtWidgets.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
return QtWidgets.QApplication.translate(context, text, disambig)
class Ui_Proxy_window(object):
......@@ -30,36 +24,36 @@ class Ui_Proxy_window(object):
"""
def setupUi(self, Proxy_window):
Proxy_window.setObjectName(_fromUtf8("Proxy_window"))
Proxy_window.setObjectName("Proxy_window")
Proxy_window.resize(344, 144)
Proxy_window.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
self.gridLayout = QtGui.QGridLayout(Proxy_window)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.label_proxy = QtGui.QLabel(Proxy_window)
self.label_proxy.setObjectName(_fromUtf8("label_proxy"))
self.gridLayout = QtWidgets.QGridLayout(Proxy_window)
self.gridLayout.setObjectName("gridLayout")
self.label_proxy = QtWidgets.QLabel(Proxy_window)
self.label_proxy.setObjectName("label_proxy")
self.gridLayout.addWidget(self.label_proxy, 0, 0, 1, 1)
self.lineEdit_proxy = QtGui.QLineEdit(Proxy_window)
self.lineEdit_proxy.setInputMask(_fromUtf8(""))
self.lineEdit_proxy.setText(_fromUtf8(""))
self.lineEdit_proxy = QtWidgets.QLineEdit(Proxy_window)
self.lineEdit_proxy.setInputMask("")
self.lineEdit_proxy.setText("")
self.lineEdit_proxy.setFrame(True)
self.lineEdit_proxy.setObjectName(_fromUtf8("lineEdit_proxy"))
self.lineEdit_proxy.setObjectName("lineEdit_proxy")
self.gridLayout.addWidget(self.lineEdit_proxy, 0, 2, 1, 1)
self.label_login_proxy = QtGui.QLabel(Proxy_window)
self.label_login_proxy.setObjectName(_fromUtf8("label_login_proxy"))
self.label_login_proxy = QtWidgets.QLabel(Proxy_window)
self.label_login_proxy.setObjectName("label_login_proxy")
self.gridLayout.addWidget(self.label_login_proxy, 1, 0, 1, 2)
self.lineEdit_login_proxy = QtGui.QLineEdit(Proxy_window)
self.lineEdit_login_proxy.setObjectName(_fromUtf8("lineEdit_login_proxy"))
self.lineEdit_login_proxy = QtWidgets.QLineEdit(Proxy_window)
self.lineEdit_login_proxy.setObjectName("lineEdit_login_proxy")
self.gridLayout.addWidget(self.lineEdit_login_proxy, 1, 2, 1, 1)
self.label_password_proxy = QtGui.QLabel(Proxy_window)
self.label_password_proxy.setObjectName(_fromUtf8("label_password_proxy"))
self.label_password_proxy = QtWidgets.QLabel(Proxy_window)
self.label_password_proxy.setObjectName("label_password_proxy")
self.gridLayout.addWidget(self.label_password_proxy, 2, 0, 1, 2)
self.lineEdit_password_proxy = QtGui.QLineEdit(Proxy_window)
self.lineEdit_password_proxy.setObjectName(_fromUtf8("lineEdit_password_proxy"))
self.lineEdit_password_proxy = QtWidgets.QLineEdit(Proxy_window)
self.lineEdit_password_proxy.setObjectName("lineEdit_password_proxy")
self.gridLayout.addWidget(self.lineEdit_password_proxy, 2, 2, 1, 1)
self.buttonBox_proxy = QtGui.QDialogButtonBox(Proxy_window)
self.buttonBox_proxy.setStandardButtons(QtGui.QDialogButtonBox.Apply|QtGui.QDialogButtonBox.Close)
self.buttonBox_proxy = QtWidgets.QDialogButtonBox(Proxy_window)
self.buttonBox_proxy.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Close)
self.buttonBox_proxy.setCenterButtons(False)
self.buttonBox_proxy.setObjectName(_fromUtf8("buttonBox_proxy"))
self.buttonBox_proxy.setObjectName("buttonBox_proxy")
self.gridLayout.addWidget(self.buttonBox_proxy, 3, 1, 1, 2)
self.retranslateUi(Proxy_window)
......
......@@ -23,21 +23,15 @@
# You should have received a copy of the GNU General Public License
# along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>.
from PyQt5 import QtCore, QtGui
# try:
# _fromUtf8 = QtCore.QString.fromUtf8
# except AttributeError:
def _fromUtf8(s):
return s
from PyQt5 import QtCore, QtWidgets
try:
_encoding = QtGui.QApplication.UnicodeUTF8
_encoding = QtWidgets.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
return QtWidgets.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
return QtWidgets.QApplication.translate(context, text, disambig)
class Ui_Warming_forgetting(object):
"""
......@@ -45,19 +39,19 @@ class Ui_Warming_forgetting(object):
"""
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.setObjectName("Form")
Form.resize(332, 102)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.label_forget = QtGui.QLabel(Form)
self.label_forget.setObjectName(_fromUtf8("label_forget"))
self.gridLayout = QtWidgets.QGridLayout(Form)
self.gridLayout.setObjectName("gridLayout")
self.label_forget = QtWidgets.QLabel(Form)
self.label_forget.setObjectName("label_forget")
self.gridLayout.addWidget(self.label_forget, 0, 0, 1, 3)
spacerItem = QtGui.QSpacerItem(93, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
spacerItem = QtWidgets.QSpacerItem(93, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 1, 0, 1, 1)
self.pushButton_ok_forget = QtGui.QPushButton(Form)
self.pushButton_ok_forget.setObjectName(_fromUtf8("pushButton_ok_forget"))
self.pushButton_ok_forget = QtWidgets.QPushButton(Form)
self.pushButton_ok_forget.setObjectName("pushButton_ok_forget")
self.gridLayout.addWidget(self.pushButton_ok_forget, 1, 1, 1, 1)
spacerItem1 = QtGui.QSpacerItem(104, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
spacerItem1 = QtWidgets.QSpacerItem(104, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
self.retranslateUi(Form)
......
......@@ -23,21 +23,15 @@
# You should have received a copy of the GNU General Public License
# along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>.
from PyQt5 import QtCore, QtGui
# try:
# _fromUtf8 = QtCore.QString.fromUtf8
# except AttributeError:
def _fromUtf8(s):
return s
from PyQt5 import QtCore, QtWidgets
try:
_encoding = QtGui.QApplication.UnicodeUTF8
_encoding = QtWidgets.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
return QtWidgets.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
return QtWidgets.QApplication.translate(context, text, disambig)
class Ui_Warming_study_area(object):
"""
......@@ -45,19 +39,19 @@ class Ui_Warming_study_area(object):
"""
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.setObjectName("Form")
Form.resize(318, 88)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout = QtWidgets.QGridLayout(Form)
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(Form)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
spacerItem = QtGui.QSpacerItem(93, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
spacerItem = QtWidgets.QSpacerItem(93, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 1, 0, 1, 1)
self.pushButton_ok_window_warning_study_area = QtGui.QPushButton(Form)
self.pushButton_ok_window_warning_study_area.setObjectName(_fromUtf8("pushButton_ok_window_warning_study_area"))
self.pushButton_ok_window_warning_study_area = QtWidgets.QPushButton(Form)
self.pushButton_ok_window_warning_study_area.setObjectName("pushButton_ok_window_warning_study_area")
self.gridLayout.addWidget(self.pushButton_ok_window_warning_study_area, 1, 1, 1, 1)
spacerItem1 = QtGui.QSpacerItem(104, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
spacerItem1 = QtWidgets.QSpacerItem(104, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
self.retranslateUi(Form)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment