/[ascend]/trunk/pygtk/interface/reporter.cpp
ViewVC logotype

Diff of /trunk/pygtk/interface/reporter.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 525 by johnpye, Wed Apr 19 04:48:32 2006 UTC revision 526 by johnpye, Fri Apr 21 13:47:31 2006 UTC
# Line 15  static const int REPORTER_MAX_ERROR_MSG Line 15  static const int REPORTER_MAX_ERROR_MSG
15  #ifdef ASCXX_USE_PYTHON  #ifdef ASCXX_USE_PYTHON
16  // Python-invoking callback function  // Python-invoking callback function
17  int reporter_error_python(ERROR_REPORTER_CALLBACK_ARGS){  int reporter_error_python(ERROR_REPORTER_CALLBACK_ARGS){
18      Reporter *reporter = Reporter::Instance();      int res=0;
19      return reporter->reportErrorPython(ERROR_REPORTER_CALLBACK_VARS);      if(filename!=NULL){
20            res += ASC_FPRINTF(ASCERR,"%s:",filename);
21        }
22        if(line!=0){
23            res += ASC_FPRINTF(ASCERR,"%d:",line);
24        }
25        if(funcname!=NULL){
26            res += ASC_FPRINTF(ASCERR,"%s:",funcname);
27        }
28        if ((filename!=NULL) || (line!=0) || (funcname!=NULL)){
29            res += ASC_FPRINTF(ASCERR," ");
30        }
31    
32        res += ASC_VFPRINTF(ASCERR,fmt,args);
33        return res;
34        //Reporter *reporter = Reporter::Instance();
35        //return reporter->reportErrorPython(ERROR_REPORTER_CALLBACK_VARS);
36  }  }
37  #endif  #endif
38    
# Line 69  Reporter::reportErrorPython(ERROR_REPORT Line 85  Reporter::reportErrorPython(ERROR_REPORT
85    
86      cerr << "reportErrorPython: msg=" << msg ;      cerr << "reportErrorPython: msg=" << msg ;
87      cerr << "reportErrorPython: pyfunc=" << pyfunc << endl;      cerr << "reportErrorPython: pyfunc=" << pyfunc << endl;
88        cerr.flush();
89    
90      pyarglist = Py_BuildValue("(H,z,i,z)",sev,filename,line,msg);             // Build argument list      pyarglist = Py_BuildValue("(H,z,i,z)",sev,filename,line,msg);             // Build argument list
91      pyresult = PyEval_CallObject(pyfunc,pyarglist);     // Call Python      pyresult = PyEval_CallObject(pyfunc,pyarglist);     // Call Python

Legend:
Removed from v.525  
changed lines
  Added in v.526

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22