1
0
mirror of https://github.com/thp/pyotherside.git synced 2025-01-28 23:52:55 +08:00

Expose module version via Python module

This commit is contained in:
Thomas Perl 2014-02-19 22:09:52 +01:00
parent 87007e0b07
commit d3c739ad7a
3 changed files with 14 additions and 0 deletions

View File

@ -289,6 +289,14 @@ These constants are used in the return value of a `image provider`_ function:
**pyotherside.format_data**
Encoded image file data (e.g. PNG/JPEG data).
.. versionadded:: 1.3.0
The following constants have been added in PyOtherSide 1.3:
**pyotherside.version**
Version of PyOtherSide as string.
Data Type Mapping
=================
@ -800,6 +808,7 @@ Version 1.3.0 (UNRELEASED)
* Access to the `Qt Resource System`_ from Python (see `Qt Resource Access`_).
* QML API 1.3: Import from Qt Resources (:func:`addImportPath` with ``qrc:/``).
* Add ``pyotherside.version`` constant to access version from Python as string.
Version 1.2.0 (2014-02-16)
--------------------------

View File

@ -5,6 +5,8 @@ import pyotherside
import threading
import time
print('Using PyOtherSide version', pyotherside.version)
COLORS = ['red', 'green', 'blue']
def thread_func():

View File

@ -189,6 +189,9 @@ PyOtherSide_init()
// Custom constant - pixels are to be interpreted as encoded image file data
PyModule_AddIntConstant(pyotherside, "format_data", -1);
// Version of PyOtherSide (new in 1.3)
PyModule_AddStringConstant(pyotherside, "version", PYOTHERSIDE_VERSION);
return pyotherside;
}