From 203ba231d0276943aae36111f9ec1e949f3c6a4c Mon Sep 17 00:00:00 2001
From: Timothy Pearson
Although libpythonize is used with (and installed with) PyKDE, it has no dependencies itself on -PyKDE/KDE, PyQt/Qt or sip. It does require qmake from TrollTech (part of Qt) to build. +PyKDE/KDE, PyTQt/TQt or sip. It does retquire qmake from TrollTech (part of TQt) to build.
-If a second instance of Pythonize is created (within the same parent process), that instance will acquire +If a second instance of Pythonize is created (within the same parent process), that instance will actquire the lock automatically. In order to allow a second (and third or more) instance of Pythonize to be created and obtain the lock, it's necessary to have a related thread state (PyThreadState). This thread state is created by a call to PyThreadState_Get when the first instance of Pythonize is created. The thread state is stored in a global variable (declared in the cpp file) that is used by all subsequent instances of Pythonize. This means that applications using libpythonize are mormally single-threaded, at least in relation to the libpythonize interpreter instance. This is important for utilization with -sip-based bindings like PyKDE and PyQt. +sip-based bindings like PyKDE and PyTQt.
The global thread state is accessible via the getThreadState/setThreadState methods. @@ -87,11 +87,11 @@ C:
-Constructor/initializer - loads and initializaes the interpreter and acquires the global interpreter lock. +Constructor/initializer - loads and initializaes the interpreter and actquires the global interpreter lock. Sets the value of pythonInit to true on success or false if construction/initialization fails Initializes the global thread state (first instance) or restores the global thread state (second and later instances). It is the programmer's resposibility to release the global interpreter lock to enable other -code to access the interpreter. The lock and thread state are automatically acquired when any Pythonize +code to access the interpreter. The lock and thread state are automatically actquired when any Pythonize instance is created..
-Runs an arbitrary string in the interpreter (indentation required for mulit-line +Runs an arbitrary string in the interpreter (indentation retquired for mulit-line strings) and returns Python's result.
-Acquires the global interpreter lock using PyEval_RestoreThread. Restores the global thread state. +Actquires the global interpreter lock using PyEval_RestoreThread. Restores the global thread state.
-Include the pythonize.h header file (requires Python.h) and link to libpythonize.so - that's pretty much it. There are unit tests +Include the pythonize.h header file (retquires Python.h) and link to libpythonize.so - that's pretty much it. There are unit tests in both C and C++ in the pythonize/tests/ subdirectory. An example of libpythonize usage is in pykpanelapplet.cpp in the PyKDE distribution (pykpanelapplet/ directory).
@@ -195,9 +195,9 @@ PyKDE distribution (pykpanelapplet/ directory). At present only the C++/C wrapper versions are available, and they're distributed with PyKDE.-The build process for libpythonize uses TrollTech's qmake (available as part of Qt), but is simple enough +The build process for libpythonize uses TrollTech's qmake (available as part of TQt), but is simple enough to be included in most make files. See the pythonize.pro file for more information - most of the additional -libs required are required by libpython, and may vary by platform. +libs retquired are retquired by libpython, and may vary by platform.
You can contact me at this address: Jim Bublitz <jbublitz@nwinternet.com> -- cgit v1.2.1