Skip to main content

[wx]Python event programming framework

Project description

https://git.fmrib.ox.ac.uk/fsl/fsleyes/props/badges/master/build.svg https://git.fmrib.ox.ac.uk/fsl/fsleyes/props/badges/master/coverage.svg

The fsleyes-props project is an event programming framework, which includes the ability for automatic CLI generation and, optionally, automatic GUI generation (if wxPython is present). It is used by FSLeyes.

Dependencies

All of the dependencies of fsleyes-props are listed in the requirements.txt file. fsleyes-props can be used without wxPython, but GUI functionality will not be available.

Documentation

fsleyes-props is documented using sphinx. 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

>>> 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.

Project details


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.1.1.tar.gz (98.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fsleyes_props-1.1.1-py2.py3-none-any.whl (103.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file fsleyes-props-1.1.1.tar.gz.

File metadata

  • Download URL: fsleyes-props-1.1.1.tar.gz
  • Upload date:
  • Size: 98.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fsleyes-props-1.1.1.tar.gz
Algorithm Hash digest
SHA256 e90386fb306c4e6bc5ab4852a487725f0587f19a32ba71110e6bc114ea636ae0
MD5 41677c6d4e0c3fa3e5e0dc2cfdcccec4
BLAKE2b-256 d4926071cfc4371c4d8626751ea7242f7c957a97526eb586426fe7669e858fc9

See more details on using hashes here.

File details

Details for the file fsleyes_props-1.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for fsleyes_props-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 aef57c376fffc14c9ff951c694f705db83d60b0f508b6e5e8be87d104d6103fb
MD5 7c954c2d88310ffe6c14f1d8bd265b1f
BLAKE2b-256 6d4fdb2aa9b0c4017423b55a94aaaddc9d6ec26a7083097031083a711ae4a30c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page