Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix to allow Cleaner and SurfOpt to deal with directory with spaces
[modules/smesh.git]
/
src
/
Tools
/
YamsPlug
/
monViewText.py
diff --git
a/src/Tools/YamsPlug/monViewText.py
b/src/Tools/YamsPlug/monViewText.py
index ddc21501e8f6e5c74ed1a3aad7c031b9c9b4a02b..9d92a0c55a7eac476d31cc47d38bc3f10d865d62 100644
(file)
--- a/
src/Tools/YamsPlug/monViewText.py
+++ b/
src/Tools/YamsPlug/monViewText.py
@@
-79,7
+79,7
@@
class MonViewText(Ui_ViewExe, QDialog):
f.write(cmds)
self.make_executable(nomFichier)
f.write(cmds)
self.make_executable(nomFichier)
- if verbose: print(
"INFO: MGSurfOpt launch script file: %s" % nomFichier
)
+ if verbose: print(
("INFO: MGSurfOpt launch script file: %s" % nomFichier)
)
self.monExe.start(nomFichier)
self.monExe.closeWriteChannel()
self.monExe.start(nomFichier)
self.monExe.closeWriteChannel()
@@
-94,24
+94,25
@@
class MonViewText(Ui_ViewExe, QDialog):
def saveFile(self):
#recuperation du nom du fichier
savedir=os.environ['HOME']
def saveFile(self):
#recuperation du nom du fichier
savedir=os.environ['HOME']
- fn = QFileDialog.getSaveFileName(None,"Save File",savedir)
- if
fn.isNull()
: return
- ulfile = os.path.abspath(
unicode
(fn))
+ fn
, mask
= QFileDialog.getSaveFileName(None,"Save File",savedir)
+ if
not fn
: return
+ ulfile = os.path.abspath(
str
(fn))
try:
f = open(fn, 'wb')
try:
f = open(fn, 'wb')
- f.write(s
tr(self.TB_Exe.toPlainText()
))
+ f.write(s
elf.TB_Exe.toPlainText().encode("utf-8"
))
f.close()
f.close()
- except IOError
,
why:
+ except IOError
as
why:
QMessageBox.critical(self, 'Save File',
QMessageBox.critical(self, 'Save File',
- 'The file <b>%
1</b> could not be saved.<br>Reason: %2'%(unicode
(fn), str(why)))
+ 'The file <b>%
s</b> could not be saved.<br>Reason: %s'%(str
(fn), str(why)))
def readFromStdErr(self):
a=self.monExe.readAllStandardError()
def readFromStdErr(self):
a=self.monExe.readAllStandardError()
- self.TB_Exe.append(unicode(a.data().encode()))
+ aa=a.data().decode(errors='ignore')
+ self.TB_Exe.append(aa)
def readFromStdOut(self) :
a=self.monExe.readAllStandardOutput()
def readFromStdOut(self) :
a=self.monExe.readAllStandardOutput()
- aa=
unicode(a.data()
)
+ aa=
a.data().decode(errors='ignore'
)
self.TB_Exe.append(aa)
def finished(self):
self.TB_Exe.append(aa)
def finished(self):