Salome HOME
projects
/
tools
/
eficas.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
optim eciture
[tools/eficas.git]
/
InterfaceQT4
/
monViewTexte.py
diff --git
a/InterfaceQT4/monViewTexte.py
b/InterfaceQT4/monViewTexte.py
index 357f2299133583adbb0916a65deeeb581d961b8f..2dfcece64768a05113f98d3c31995779f7373d38 100644
(file)
--- a/
InterfaceQT4/monViewTexte.py
+++ b/
InterfaceQT4/monViewTexte.py
@@
-18,18
+18,19
@@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# Modules Python
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# Modules Python
-import string,types,os
+from __future__ import absolute_import
+try :
+ from builtins import str
+except : pass
+
+import types,os
import traceback
from Extensions.i18n import tr
import traceback
from Extensions.i18n import tr
+import six
-from determine import monEnvQT5
-if monEnvQT5 :
- from PyQt5.QtWidgets import QDialog, QMessageBox, QFileDialog
- from PyQt5.QtCore import QSize
-else :
- from PyQt4.QtGui import *
- from PyQt4.QtCore import *
+from PyQt5.QtWidgets import QDialog, QMessageBox, QFileDialog
+from PyQt5.QtCore import QSize
from desViewTexte import Ui_dView
# ------------------------------- #
from desViewTexte import Ui_dView
# ------------------------------- #
@@
-44,12
+45,9
@@
class ViewText(Ui_dView,QDialog):
self.setupUi(self)
self.resize( QSize(largeur,hauteur).expandedTo(self.minimumSizeHint()) )
self.setupUi(self)
self.resize( QSize(largeur,hauteur).expandedTo(self.minimumSizeHint()) )
- if monEnvQT5 :
- self.bclose.clicked.connect(self.close)
- self.bsave.clicked.connect(self.saveFile )
- else :
- self.connect( self.bclose,SIGNAL("clicked()"), self, SLOT("close()") )
- self.connect( self.bsave,SIGNAL("clicked()"), self.saveFile )
+ self.bclose.clicked.connect(self.close)
+ self.bsave.clicked.connect(self.saveFile )
+
if entete != None : self.setWindowTitle (entete)
if entete != None : self.setText (texte)
if entete != None : self.setWindowTitle (entete)
if entete != None : self.setText (texte)
@@
-66,15
+64,15
@@
class ViewText(Ui_dView,QDialog):
fn = QFileDialog.getSaveFileName(None,
tr("Sauvegarder le fichier"),
dir)
fn = QFileDialog.getSaveFileName(None,
tr("Sauvegarder le fichier"),
dir)
-
if monEnvQT5 :
fn=fn[0]
+ fn=fn[0]
if fn == "" : return
if fn == None : return (0, None)
if fn == "" : return
if fn == None : return (0, None)
- ulfile = os.path.abspath(
unicod
e(fn))
+ ulfile = os.path.abspath(
six.text_typ
e(fn))
if self.editor != None :
self.editor.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0]
try:
if self.editor != None :
self.editor.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0]
try:
- f = open(fn, 'w
b
')
+ f = open(fn, 'w')
f.write(str(self.view.toPlainText()))
f.close()
return 1
f.write(str(self.view.toPlainText()))
f.close()
return 1
@@
-84,4
+82,3
@@
class ViewText(Ui_dView,QDialog):
return
return
-