2 from subprocess import Popen
3 from os import remove, getpid, path
10 def message(typ, message, goOn=False):
12 log.message(typ,message,goOn)
15 def __init__(self, tmpDir, tmpFile='Messages.txt'):
16 self.tmpFile=path.join(tmpDir,tmpFile)
23 f = open(self.tmpFile,'w')
24 f.write('\n ------------------------------\n')
25 f.write(' | BIENVENUE DANS L\'INTERFACE |\n')
26 f.write(' | ZCRACKS DE SALOME |\n')
27 f.write(' | VERSION BETA |\n')
28 f.write(' ------------------------------\n\n')
32 fenName='Zcracks message log'
33 proc = Popen(['xterm -T "%s" -e "tail -s 0.05 -f %s --pid=%d"' %(fenName,self.tmpFile,pid)], shell=True)
36 def message(self, typ, message='', goOn=False):
38 f = open(fileName,'a')
40 f.write('ERROR: '+message+'\n')
41 #print 'ERROR: '+message
45 elif typ in ['A','W']:
46 #print ARNING: '+message
47 f.write('WARNING: '+message+'\n')
49 elif typ in ['M','I']:
50 #print 'INFO: '+message