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:
parent
87007e0b07
commit
d3c739ad7a
@ -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)
|
||||
--------------------------
|
||||
|
@ -5,6 +5,8 @@ import pyotherside
|
||||
import threading
|
||||
import time
|
||||
|
||||
print('Using PyOtherSide version', pyotherside.version)
|
||||
|
||||
COLORS = ['red', 'green', 'blue']
|
||||
|
||||
def thread_func():
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user