aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormorefigs <morefigs@gmail.com>2019-01-30 14:27:49 +1100
committermorefigs <morefigs@gmail.com>2019-01-30 14:27:49 +1100
commitcbceaff013690eecec2298b14810ef9e643770f2 (patch)
tree575e0ccee7d52cfc8cb8edf3737dbb1fd4a82c03
parent6d6fc471aceff5802fc3ad5db3d35521e87abf4c (diff)
downloadpymba-cbceaff013690eecec2298b14810ef9e643770f2.tar.gz
pymba-cbceaff013690eecec2298b14810ef9e643770f2.zip
make version a staticmethod
-rw-r--r--pymba/vimba.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/pymba/vimba.py b/pymba/vimba.py
index 795e03f..02c29c7 100644
--- a/pymba/vimba.py
+++ b/pymba/vimba.py
@@ -13,7 +13,19 @@ class Vimba:
Python wrapper for Allied Vision's Vimba C API.
"""
- # todo - assign camera info and feature info as own object properties
+ @staticmethod
+ def version() -> str:
+ """
+ Retrieve the version number of the Vimba C API.
+ """
+ vmb_version_info = vimba_c.VmbVersionInfo()
+ error = vimba_c.vmb_version_query(vmb_version_info, sizeof(vmb_version_info))
+ if error:
+ raise VimbaException(error)
+
+ return '.'.join(str(x) for x in (vmb_version_info.major,
+ vmb_version_info.minor,
+ vmb_version_info.patch))
def __init__(self):
# create own system singleton object
@@ -36,20 +48,6 @@ class Vimba:
"""
self.shutdown()
- @property
- def version(self) -> str:
- """
- Retrieve the version number of the Vimba C API.
- """
- vmb_version_info = vimba_c.VmbVersionInfo()
- error = vimba_c.vmb_version_query(vmb_version_info, sizeof(vmb_version_info))
- if error:
- raise VimbaException(error)
-
- return '.'.join(str(x) for x in (vmb_version_info.major,
- vmb_version_info.minor,
- vmb_version_info.patch))
-
def startup(self):
"""
Initialize the Vimba C API.