PythonScripting Class Reference

#include <PythonScripting.h>

Inheritance diagram for PythonScripting:

ScriptingEnv

List of all members.

Public Member Functions

QString errorMsg ()
PyObjecteval (const QString &code, PyObject *argDict=NULL, const char *name="<qtiplot>")
 evaluate a Python expression
bool exec (const QString &code, PyObject *argDict=NULL, const char *name="<qtiplot>")
 execute a sequence of Python statements
const QStringList fileExtensions () const
 Return a list of file extensions commonly used for this language.
PyObjectglobalDict ()
bool initialize ()
 Part of the initialization is deferred from the constructor until after the signals have been connected.
bool isRunning () const
 whether asynchronuous execution is enabled (if supported by the implementation)
const QString mathFunctionDoc (const QString &name) const
 Return a documentation string for the given mathematical function.
const QStringList mathFunctions () const
 Return a list of supported mathematical functions. These should be imported into the global namespace.
ScriptnewScript (const QString &code, QObject *context, const QString &name="<input>")
 Instantiate the Script subclass matching the ScriptEnv subclass.
 PythonScripting (ApplicationWindow *parent)
bool setDouble (double, const char *, PyObject *dict=NULL)
bool setInt (int, const char *, PyObject *dict=NULL)
bool setQObject (QObject *val, const char *name)
bool setQObject (QObject *, const char *, PyObject *dict)
PyObjectsysDict ()
QString toString (PyObject *object, bool decref=false)
 like str(object) in Python
void write (const QString &text)
 ~PythonScripting ()

Static Public Member Functions

static ScriptingEnvconstructor (ApplicationWindow *parent)

Static Public Attributes

static const char * langName = "Python"

Private Member Functions

bool loadInitFile (const QString &path)

Private Attributes

PyObjectglobals
PyObjectmath
PyObjectsys


Constructor & Destructor Documentation

PythonScripting::PythonScripting ( ApplicationWindow parent  ) 

PythonScripting::~PythonScripting (  ) 


Member Function Documentation

static ScriptingEnv* PythonScripting::constructor ( ApplicationWindow parent  )  [inline, static]

QString PythonScripting::errorMsg (  ) 

PyObject * PythonScripting::eval ( const QString &  code,
PyObject argDict = NULL,
const char *  name = "<qtiplot>" 
)

evaluate a Python expression

Evaluates code, using argDict (borrowed reference) as local dictionary or an empty one if argDict==NULL. name is the filename Python uses when reporting errors. Returns a new reference; NULL means caller has to do exception handling.

bool PythonScripting::exec ( const QString &  code,
PyObject argDict = NULL,
const char *  name = "<qtiplot>" 
)

execute a sequence of Python statements

Executes code, using argDict (borrowed reference) as local dictionary or an empty one if argDict==NULL. name is the filename Python uses when reporting errors. A false return value means caller has to do exception handling.

const QStringList PythonScripting::fileExtensions (  )  const [virtual]

Return a list of file extensions commonly used for this language.

Reimplemented from ScriptingEnv.

PyObject* PythonScripting::globalDict (  )  [inline]

bool PythonScripting::initialize (  )  [virtual]

Part of the initialization is deferred from the constructor until after the signals have been connected.

Reimplemented from ScriptingEnv.

bool PythonScripting::isRunning (  )  const [virtual]

whether asynchronuous execution is enabled (if supported by the implementation)

Reimplemented from ScriptingEnv.

bool PythonScripting::loadInitFile ( const QString &  path  )  [private]

const QString PythonScripting::mathFunctionDoc ( const QString &   )  const [virtual]

Return a documentation string for the given mathematical function.

Reimplemented from ScriptingEnv.

const QStringList PythonScripting::mathFunctions (  )  const [virtual]

Return a list of supported mathematical functions. These should be imported into the global namespace.

Reimplemented from ScriptingEnv.

Script* PythonScripting::newScript ( const QString &  ,
QObject *  ,
const QString &  = "<input>" 
) [inline, virtual]

Instantiate the Script subclass matching the ScriptEnv subclass.

Reimplemented from ScriptingEnv.

bool PythonScripting::setDouble ( double  val,
const char *  name,
PyObject dict = NULL 
)

bool PythonScripting::setInt ( int  val,
const char *  name,
PyObject dict = NULL 
)

bool PythonScripting::setQObject ( QObject *  val,
const char *  name 
) [inline, virtual]

Reimplemented from ScriptingEnv.

bool PythonScripting::setQObject ( QObject *  val,
const char *  name,
PyObject dict 
)

PyObject* PythonScripting::sysDict (  )  [inline]

QString PythonScripting::toString ( PyObject object,
bool  decref = false 
)

like str(object) in Python

Convert object to a string. Steals a reference to object if decref is true; borrows otherwise.

void PythonScripting::write ( const QString &  text  )  [inline]


Member Data Documentation

PyObject* PythonScripting::globals [private]

const char * PythonScripting::langName = "Python" [static]

PyObject* PythonScripting::math [private]

PyObject* PythonScripting::sys [private]


The documentation for this class was generated from the following files:
Generated on Thu Feb 7 13:59:29 2008 for QtiPlot by  doxygen 1.5.4