MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PyRun.cpp File Reference
#include "Python.h"
#include "../basecode/header.h"
#include "PyRun.h"
+ Include dependency graph for PyRun.cpp:

Go to the source code of this file.

Functions

void handleError (bool syntax)
 
static SrcFinfo1< double > * outputOut ()
 

Variables

static const CinfopyRunCinfo = PyRun::initCinfo()
 

Function Documentation

void handleError ( bool  syntax)

This is derived from: http://effbot.org/pyfaq/how-do-i-tell-incomplete-input-from-invalid-input.htm

Definition at line 335 of file PyRun.cpp.

Referenced by PyRun::reinit().

336 {
337  PyObject *exc, *val, *trb;
338  char * msg;
339 
340  if (syntax && PyErr_ExceptionMatches (PyExc_SyntaxError)){
341  PyErr_Fetch (&exc, &val, &trb); /* clears exception! */
342 
343  if (PyArg_ParseTuple (val, "sO", &msg, &trb) &&
344  !strcmp (msg, "unexpected EOF while parsing")){ /* E_EOF */
345  Py_XDECREF (exc);
346  Py_XDECREF (val);
347  Py_XDECREF (trb);
348  } else { /* some other syntax error */
349  PyErr_Restore (exc, val, trb);
350  PyErr_Print ();
351  }
352  } else { /* some non-syntax error */
353  PyErr_Print ();
354  }
355 }

+ Here is the caller graph for this function:

static SrcFinfo1< double >* outputOut ( )
static

Definition at line 56 of file PyRun.cpp.

Referenced by PyRun::initCinfo(), PyRun::process(), PyRun::run(), and PyRun::trigger().

57 {
58  static SrcFinfo1< double > outputOut( "output",
59  "Sends out the value of local variable called `output`. Thus, you can"
60  " have Python statements which compute some value and assign it to the"
61  " variable called `output` (which is defined at `reinit` call). This"
62  " will be sent out to any target connected to the `output` field.");
63  return &outputOut;
64 }
static SrcFinfo1< double > * outputOut()
Definition: PyRun.cpp:56

+ Here is the caller graph for this function:

Variable Documentation

const Cinfo* pyRunCinfo = PyRun::initCinfo()
static

Definition at line 180 of file PyRun.cpp.

Referenced by PyRun::initCinfo().