X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=functions.py;h=54ead63646937f2c9ffa46d23beccbde557d92a4;hp=aee5d9bc77971fc856550e53ea54352f31589045;hb=0f8b4705852de1679aba3e91c9809fe2250a715c;hpb=5d8a0a0e99d9075adc28f2525fe0aba8e14c2b0a diff --git a/functions.py b/functions.py index aee5d9b..54ead63 100644 --- a/functions.py +++ b/functions.py @@ -388,23 +388,14 @@ def BugReport(parent, error = None): txt += exc dial = BugDialog(parent) - #for line in formatExceptionInfo(): - # if type(line) == type([]): - # for don in line: - # txt += don.replace(' ', ' ') - # else: - # txt += line + '\n' if 'Rerror' in dir(parent) : txt += parent.Rerror parent.Rerror = '' - #if error is not None : - # txt += '\n%s\n' %error - print formatExceptionInfo() - log.error(txt) + log.info(txt) dial.text_ctrl_1.write(txt) dial.CenterOnParent() dial.ShowModal() - #raise Exception('Bug') + dial.Destroy() def PlaySound(parent): if parent.pref.getboolean('iramuteq', 'sound') : @@ -462,6 +453,12 @@ def ReadList(filein, encoding = sys.getdefaultencoding()): i += 1 return dict, first +def exec_RCMD(rpath, command) : + log.info('R CMD INSTALL %s' % command) + rpath = rpath.replace('\\','\\\\') + error = call(["%s" % rpath, 'CMD', 'INSTALL', "%s" % command]) + return error + def exec_rcode(rpath, rcode, wait = True, graph = False): log.info("R Script : %s" % rcode) needX11 = False @@ -518,16 +515,22 @@ def check_Rresult(parent, pid) : if error[1] is None : error[1] = 'None' parent.Rerror = '\n'.join([str(pid.returncode), '\n'.join(error)]) - try : - raise Exception('\n'.join(u'Erreur R', '\n'.join(error[1:]))) - except : - BugReport(parent) + #try : + raise Exception('\n'.join([u'Erreur R', '\n'.join(error[1:])])) + return False + #except : + # BugReport(parent) + else : + return None else : if pid != 0 : - try : - raise Exception(u'Erreur R') - except : - BugReport(parent) + #try : + raise Exception(u'Erreur R') + return False + #except : + # BugReport(parent) + else : + return None def print_liste(filename,liste): with open(filename,'w') as f :