[wx]Python event programming framework
Project description
fsleyes-props
=============
The `fsleyes-props` project is an event programming framework, which includes
the ability for automatic CLI generation and, optionally, automatic GUI
generation (if [wxPython](http://www.wxpython.org) is present). It is used by
[FSLeyes](https://git.fmrib.ox.ac.uk/paulmc/fsleyes/).
Dependencies
------------
All of the dependencies of `fsleyes-props` are listed in the
[requirements.txt](requirements.txt) file. `fsleyes-props` can be used without
wxPython, but GUI functionality will not be available.
Documentation
-------------
`fsleyes-props` is documented using
[sphinx](http://http://sphinx-doc.org/). You can build the API documentation
by running:
python setup.py doc
The HTML documentation will be generated and saved in the `doc/html/` directory.
Example usage
-------------
```python
>>> import fsleyes_props as props
>>> class PropObj(props.HasProperties):
>>> myProperty = props.Boolean()
>>> myPropObj = PropObj()
# Access the property value as a normal attribute:
>>> myPropObj.myProperty = True
>>> myPropObj.myProperty
>>> True
# access the props.Boolean instance:
>>> myPropObj.getProp('myProperty')
>>> <props.prop.Boolean at 0x1045e2710>
# access the underlying props.PropertyValue object
# (there are caveats for List properties):
>>> myPropObj.getPropVal('myProperty')
>>> <props.prop.PropertyValue instance at 0x1047ef518>
# Receive notification of property value changes
>>> def myPropertyChanged(value, *args):
>>> print('New property value: {}'.format(value))
>>> myPropObj.addListener(
>>> 'myProperty', 'myListener', myPropertyChanged)
>>> myPropObj.myProperty = False
>>> New property value: False
# Remove a previously added listener
>>> myPropObj.removeListener('myListener')
```
Contributing
------------
If you would like to contribute to `fsleyes-props`, take a look at the
`fslpy` [contributing
guide](https://git.fmrib.ox.ac.uk/fsl/fslpy/blob/master/doc/contributing.rst).
=============
The `fsleyes-props` project is an event programming framework, which includes
the ability for automatic CLI generation and, optionally, automatic GUI
generation (if [wxPython](http://www.wxpython.org) is present). It is used by
[FSLeyes](https://git.fmrib.ox.ac.uk/paulmc/fsleyes/).
Dependencies
------------
All of the dependencies of `fsleyes-props` are listed in the
[requirements.txt](requirements.txt) file. `fsleyes-props` can be used without
wxPython, but GUI functionality will not be available.
Documentation
-------------
`fsleyes-props` is documented using
[sphinx](http://http://sphinx-doc.org/). You can build the API documentation
by running:
python setup.py doc
The HTML documentation will be generated and saved in the `doc/html/` directory.
Example usage
-------------
```python
>>> import fsleyes_props as props
>>> class PropObj(props.HasProperties):
>>> myProperty = props.Boolean()
>>> myPropObj = PropObj()
# Access the property value as a normal attribute:
>>> myPropObj.myProperty = True
>>> myPropObj.myProperty
>>> True
# access the props.Boolean instance:
>>> myPropObj.getProp('myProperty')
>>> <props.prop.Boolean at 0x1045e2710>
# access the underlying props.PropertyValue object
# (there are caveats for List properties):
>>> myPropObj.getPropVal('myProperty')
>>> <props.prop.PropertyValue instance at 0x1047ef518>
# Receive notification of property value changes
>>> def myPropertyChanged(value, *args):
>>> print('New property value: {}'.format(value))
>>> myPropObj.addListener(
>>> 'myProperty', 'myListener', myPropertyChanged)
>>> myPropObj.myProperty = False
>>> New property value: False
# Remove a previously added listener
>>> myPropObj.removeListener('myListener')
```
Contributing
------------
If you would like to contribute to `fsleyes-props`, take a look at the
`fslpy` [contributing
guide](https://git.fmrib.ox.ac.uk/fsl/fslpy/blob/master/doc/contributing.rst).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fsleyes-props-1.0.1.tar.gz
(95.8 kB
view hashes)
Built Distribution
Close
Hashes for fsleyes_props-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18a65986b48f3b8edff64734118a121aea3132dfa038485d1b858d16be432165 |
|
MD5 | ae3bc77eb1411d9f099d809f18af59ea |
|
BLAKE2b-256 | 2b47fb04ea4426318696a60918d6183bda6cdcf9fb6f47868ca2a3cbe91bfed6 |