aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pymba/__init__.py2
-rw-r--r--pymba/vimba.py20
-rw-r--r--pymba/vimba_camera.py (renamed from pymba/vimbacamera.py)10
-rw-r--r--pymba/vimba_dll.py (renamed from pymba/vimbadll.py)4
-rw-r--r--pymba/vimba_exception.py (renamed from pymba/vimbaexception.py)0
-rw-r--r--pymba/vimba_feature.py (renamed from pymba/vimbafeature.py)8
-rw-r--r--pymba/vimba_frame.py (renamed from pymba/vimbaframe.py)12
-rw-r--r--pymba/vimba_interface.py (renamed from pymba/vimbainterface.py)8
-rw-r--r--pymba/vimba_object.py (renamed from pymba/vimbaobject.py)38
-rw-r--r--pymba/vimba_structure.py (renamed from pymba/vimbastructure.py)0
-rw-r--r--pymba/vimba_system.py (renamed from pymba/vimbasystem.py)4
-rw-r--r--tests/__init__.py (renamed from pymba/tests/__init__.py)0
-rw-r--r--tests/opencv_example.py (renamed from pymba/tests/opencv_example.py)0
-rw-r--r--tests/opencv_liveview_example.py (renamed from pymba/tests/opencv_liveview_example.py)0
-rw-r--r--tests/opencv_liveview_example_color.py (renamed from pymba/tests/opencv_liveview_example_color.py)0
-rw-r--r--tests/test_cameras.py (renamed from pymba/tests/test_cameras.py)0
-rw-r--r--tests/test_enumfeature.py (renamed from pymba/tests/test_enumfeature.py)0
-rw-r--r--tests/test_installation.py (renamed from pymba/tests/test_installation.py)0
-rw-r--r--tests/test_interfaces.py (renamed from pymba/tests/test_interfaces.py)0
-rw-r--r--tests/test_systemfeature.py (renamed from pymba/tests/test_systemfeature.py)0
20 files changed, 51 insertions, 55 deletions
diff --git a/pymba/__init__.py b/pymba/__init__.py
index c6c69cd..c21ed07 100644
--- a/pymba/__init__.py
+++ b/pymba/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .vimba import Vimba
-from .vimbaexception import VimbaException
+from .vimba_exception import VimbaException
diff --git a/pymba/vimba.py b/pymba/vimba.py
index a1ffeaa..5656b7c 100644
--- a/pymba/vimba.py
+++ b/pymba/vimba.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from . import vimbastructure as structs
-from .vimbadll import VimbaDLL
-from .vimbaexception import VimbaException
-from .vimbasystem import VimbaSystem
-from .vimbacamera import VimbaCamera
-from .vimbainterface import VimbaInterface
+from . import vimba_structure as structs
+from .vimba_dll import VimbaDLL
+from .vimba_exception import VimbaException
+from .vimba_system import VimbaSystem
+from .vimba_camera import VimbaCamera
+from .vimba_interface import VimbaInterface
from ctypes import *
@@ -247,9 +247,11 @@ class Vimba(object):
versionInfo = structs.VimbaVersion()
# Vimba DLL will return an error code
- errorCode = VimbaDLL.versionQuery(versionInfo,
- sizeof(versionInfo))
- if errorCode != 0:
+ errorCode = VimbaDLL.versionQuery(
+ versionInfo,
+ sizeof(versionInfo)
+ )
+ if errorCode:
raise VimbaException(errorCode)
versionStr = '.'.join([str(versionInfo.major),
diff --git a/pymba/vimbacamera.py b/pymba/vimba_camera.py
index 0a96a71..5e131a1 100644
--- a/pymba/vimbacamera.py
+++ b/pymba/vimba_camera.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from . import vimbastructure as structs
-from .vimbaobject import VimbaObject
-from .vimbaexception import VimbaException
-from .vimbaframe import VimbaFrame
-from .vimbadll import VimbaDLL
+from . import vimba_structure as structs
+from .vimba_object import VimbaObject
+from .vimba_exception import VimbaException
+from .vimba_frame import VimbaFrame
+from .vimba_dll import VimbaDLL
from ctypes import *
# camera features are automatically readable as object attributes.
diff --git a/pymba/vimbadll.py b/pymba/vimba_dll.py
index a6b9f3c..a62b087 100644
--- a/pymba/vimbadll.py
+++ b/pymba/vimba_dll.py
@@ -6,8 +6,8 @@ import platform
import os
from ctypes import *
-from . import vimbastructure as structs
-from .vimbaexception import VimbaException
+from . import vimba_structure as structs
+from .vimba_exception import VimbaException
if sys_plat == "win32":
diff --git a/pymba/vimbaexception.py b/pymba/vimba_exception.py
index 6269543..6269543 100644
--- a/pymba/vimbaexception.py
+++ b/pymba/vimba_exception.py
diff --git a/pymba/vimbafeature.py b/pymba/vimba_feature.py
index 88275ce..3e838f0 100644
--- a/pymba/vimbafeature.py
+++ b/pymba/vimba_feature.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from . import vimbastructure as structs
-from .vimbaexception import VimbaException
-from .vimbadll import VimbaDLL
+from . import vimba_structure as structs
+from .vimba_exception import VimbaException
+from .vimba_dll import VimbaDLL
from ctypes import *
# class may extend a generic Vimba entity class one day...
@@ -283,7 +283,7 @@ class VimbaFeature(object):
if errorCode != 0:
raise VimbaException(errorCode)
- return (int(str(minToGet.value)), int(str(maxToGet.value)))
+ return int(str(minToGet.value)), int(str(maxToGet.value))
def _rangeQueryFloatFeature(self):
"""
diff --git a/pymba/vimbaframe.py b/pymba/vimba_frame.py
index a95f6a7..8f6d797 100644
--- a/pymba/vimbaframe.py
+++ b/pymba/vimba_frame.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from . import vimbastructure as structs
-from .vimbaexception import VimbaException
-from .vimbadll import VimbaDLL
-from .vimbadll import VimbaC_MemoryBlock
+from . import vimba_structure as structs
+from .vimba_exception import VimbaException
+from .vimba_dll import VimbaDLL
+from .vimba_dll import VimbaC_MemoryBlock
from ctypes import *
import warnings
try:
@@ -94,7 +94,7 @@ class VimbaFrame(object):
def queueFrameCapture(self, frameCallback = None):
"""
- Queue frames that may be filled during frame capturing.
+ Queue frames that may be filled during frame capturing.
Runs VmbCaptureFrameQueue
Call after announceFrame and startCapture
@@ -127,7 +127,7 @@ class VimbaFrame(object):
def waitFrameCapture(self, timeout=2000):
"""
- Wait for a queued frame to be filled (or dequeued). Returns Errorcode
+ Wait for a queued frame to be filled (or dequeued). Returns Errorcode
upon completion.
Runs VmbCaptureFrameWait
diff --git a/pymba/vimbainterface.py b/pymba/vimba_interface.py
index 82a0c2e..df5acdc 100644
--- a/pymba/vimbainterface.py
+++ b/pymba/vimba_interface.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from . import vimbastructure as structs
-from .vimbaobject import VimbaObject
-from .vimbaexception import VimbaException
-from .vimbadll import VimbaDLL
+from . import vimba_structure as structs
+from .vimba_object import VimbaObject
+from .vimba_exception import VimbaException
+from .vimba_dll import VimbaDLL
from ctypes import *
# interface features are automatically readable as object attributes.
diff --git a/pymba/vimbaobject.py b/pymba/vimba_object.py
index 69a047c..5f1cead 100644
--- a/pymba/vimbaobject.py
+++ b/pymba/vimba_object.py
@@ -1,19 +1,17 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from . import vimbastructure as structs
-from .vimbaexception import VimbaException
-from .vimbafeature import VimbaFeature
-from .vimbadll import VimbaDLL
+from . import vimba_structure as structs
+from .vimba_exception import VimbaException
+from .vimba_feature import VimbaFeature
+from .vimba_dll import VimbaDLL
from ctypes import *
class VimbaObject(object):
-
"""
A Vimba object has a handle and features associated with it.
Objects include System, Camera, Interface and AncillaryData.
"""
-
@property
def handle(self):
return self._handle
@@ -22,24 +20,19 @@ class VimbaObject(object):
# create own handle
self._handle = c_void_p()
- # list of VimbaFeatureInfo objects
- # can't set yet as the object (e.g. a camera) won't be
- # opened yet, therefore no event for object opening
- # so will have it populate by user interaction
- # and blame them if the object is not opened then
+ # list of VimbaFeatureInfo objects can't set yet as the object (e.g. a camera) won't be opened yet, therefore
+ # no event for object opening so will have it populate by user interaction and blame them if the object is not
+ # opened then
self._featureInfos = None
# override getattr for undefined attributes
def __getattr__(self, attr):
-
# if a feature value requested (requires object (camera) open)
if attr in self.getFeatureNames():
return VimbaFeature(attr, self._handle).value
# otherwise don't know about it
- raise AttributeError(''.join(["'VimbaObject' has no attribute '",
- attr,
- "'"]))
+ raise AttributeError(''.join(["'VimbaObject' has no attribute '", attr, "'"]))
# override setattr for undefined attributes
def __setattr__(self, attr, val):
@@ -147,23 +140,26 @@ class VimbaObject(object):
:param featureName: the name of the feature.
"""
# run a command
- errorCode = VimbaDLL.featureCommandRun(self._handle,
- featureName.encode())
+ errorCode = VimbaDLL.featureCommandRun(
+ self._handle,
+ featureName.encode()
+ )
if errorCode != 0:
raise VimbaException(errorCode)
def featureCommandIsDone(self, featureName):
isDone = c_bool()
- errorCode = VimbaDLL.featureCommandIsDone(self._handle,
- featureName.encode(),
- byref(isDone))
+ errorCode = VimbaDLL.featureCommandIsDone(
+ self._handle,
+ featureName.encode(),
+ byref(isDone)
+ )
if errorCode != 0:
raise VimbaException(errorCode)
return isDone.value
-
def readRegister(self, address):
# note that the underlying Vimba function allows reading of an array
# of registers, but only one address/value at a time is implemented
diff --git a/pymba/vimbastructure.py b/pymba/vimba_structure.py
index 73c4e96..73c4e96 100644
--- a/pymba/vimbastructure.py
+++ b/pymba/vimba_structure.py
diff --git a/pymba/vimbasystem.py b/pymba/vimba_system.py
index d1f9603..f4d0c54 100644
--- a/pymba/vimbasystem.py
+++ b/pymba/vimba_system.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from .vimbaobject import VimbaObject
+from .vimba_object import VimbaObject
from ctypes import c_void_p
# system features are automatically readable as attributes.
@@ -16,8 +16,6 @@ class VimbaSystem(VimbaObject):
# own handle is inherited as self._handle
def __init__(self):
-
- # call super constructor
super(VimbaSystem, self).__init__()
# set own handle manually
diff --git a/pymba/tests/__init__.py b/tests/__init__.py
index e69de29..e69de29 100644
--- a/pymba/tests/__init__.py
+++ b/tests/__init__.py
diff --git a/pymba/tests/opencv_example.py b/tests/opencv_example.py
index 238e8b4..238e8b4 100644
--- a/pymba/tests/opencv_example.py
+++ b/tests/opencv_example.py
diff --git a/pymba/tests/opencv_liveview_example.py b/tests/opencv_liveview_example.py
index 78b6b67..78b6b67 100644
--- a/pymba/tests/opencv_liveview_example.py
+++ b/tests/opencv_liveview_example.py
diff --git a/pymba/tests/opencv_liveview_example_color.py b/tests/opencv_liveview_example_color.py
index fd7a819..fd7a819 100644
--- a/pymba/tests/opencv_liveview_example_color.py
+++ b/tests/opencv_liveview_example_color.py
diff --git a/pymba/tests/test_cameras.py b/tests/test_cameras.py
index a5a4dd9..a5a4dd9 100644
--- a/pymba/tests/test_cameras.py
+++ b/tests/test_cameras.py
diff --git a/pymba/tests/test_enumfeature.py b/tests/test_enumfeature.py
index 7f9dd4c..7f9dd4c 100644
--- a/pymba/tests/test_enumfeature.py
+++ b/tests/test_enumfeature.py
diff --git a/pymba/tests/test_installation.py b/tests/test_installation.py
index 06af7d6..06af7d6 100644
--- a/pymba/tests/test_installation.py
+++ b/tests/test_installation.py
diff --git a/pymba/tests/test_interfaces.py b/tests/test_interfaces.py
index 270d42c..270d42c 100644
--- a/pymba/tests/test_interfaces.py
+++ b/tests/test_interfaces.py
diff --git a/pymba/tests/test_systemfeature.py b/tests/test_systemfeature.py
index abb4da7..abb4da7 100644
--- a/pymba/tests/test_systemfeature.py
+++ b/tests/test_systemfeature.py