mirror of
https://github.com/thp/pyotherside.git
synced 2025-01-28 23:52:55 +08:00
Alex Toldaiev
8ad6d92bba
importNames, import specific objects from a module to Python's global space
The importNames and importNames_sync adopt the protocol of importModule. The importNames(module_name, [objects_names], callback) is asynchronous. It calls the synchronous importNames_sync(module_name, [object_names]) via the signal import_names. importNames_sync imports the module (with PyImport_ImportModule(moduleName)) and loops over the given names trying to get the corresponding object from the module (by PyObject_GetAttrString). On success the object is inserted into the global space of the Python interpreter. (priv->globals.borrow() is the pointer to the corresponding Python dict.) Each failed import separately emits the error message and continues to the next iteration. Changes to be committed: modified: src/qpython.cpp modified: src/qpython.h modified: src/qpython_worker.cpp modified: src/qpython_worker.h
PyOtherSide: Asynchronous Python 3 Bindings for Qt 5 ==================================================== A Qt 5 QML Plugin that provides access to a Python 3 interpreter from QML. Requirements: Qt >= 5.1.0 Python >= 3.3.0 To build and install the QML plugin: qmake make make install To build against a specific Python version, use: qmake PYTHON_CONFIG=python3.3-config make make install To manually update the qmltypes file on x64 Linux (TODO: make this automated): qmake make make INSTALL_ROOT=$(pwd)/tmp/ qmlplugindump io.thp.pyotherside 1.0 tmp/usr/lib/x86_64-linux-gnu/qt5/qml \ >src/pyotherside.qmltypes To run the included unit tests after building, use: ./tests/tests If you want to link PyOtherSide statically against Python 3, you can include the Python Standard Library in PyOtherSide as Qt Resource and have it extracted automatically on load, for this, zip up the Standard Library and place the .zip file as "pythonlib.zip" into src/ before running qmake. More information: Project page: https://thp.io/2011/pyotherside/ Git repo: http://github.com/thp/pyotherside/ Bug tracker: https://github.com/thp/pyotherside/issues Documentation: http://pyotherside.readthedocs.org/
Languages
C++
83.2%
QML
10.2%
Python
2.7%
QMake
1.8%
C
1.6%
Other
0.5%