[mousetrap/gnome3-wip: 90/240] De-lint.



commit 48ab8cee88d4c5dac4d6da937b4f39b52ae29479
Author: Stoney Jackson <dr stoney gmail com>
Date:   Thu Jun 12 14:31:11 2014 -0400

    De-lint.

 src/mousetrap/pointers/nose.py |    2 +-
 src/mousetrap/vision.py        |   12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/mousetrap/pointers/nose.py b/src/mousetrap/pointers/nose.py
index 9c8e29e..b4869d2 100644
--- a/src/mousetrap/pointers/nose.py
+++ b/src/mousetrap/pointers/nose.py
@@ -16,7 +16,7 @@ class Pointer(interface.Pointer):
             point_image = self._nose_locator.locate(image)
             point_screen = self._convert_image_to_screen_point(*point_image)
             self._location = point_screen
-        except FeatureNotFoundException as error:
+        except FeatureNotFoundException:
             self._location = None
 
     def _convert_image_to_screen_point(self, image_x, image_y):
diff --git a/src/mousetrap/vision.py b/src/mousetrap/vision.py
index 2a076fd..7b97e64 100644
--- a/src/mousetrap/vision.py
+++ b/src/mousetrap/vision.py
@@ -10,20 +10,20 @@ from mousetrap.image import Image
 class Camera(object):
     S_CAPTURE_OPEN_ERROR = 'Device #%d does not support video capture interface'
     S_CAPTURE_READ_ERROR = 'Error while capturing. Camera disconnected?'
-    SEARCH_FOR_DEVICE=-1
+    SEARCH_FOR_DEVICE = -1
 
     def __init__(self, device_index=SEARCH_FOR_DEVICE, width=400, height=300):
         self._device = self._new_capture_device(device_index)
         self.set_dimensions(width, height)
 
-    @staticmethod
-    def _new_capture_device(device_index):
+    @classmethod
+    def _new_capture_device(cls, device_index):
         capture = cv2.VideoCapture(device_index)
 
         if not capture.isOpened():
             capture.release()
 
-            raise IOError(S_CAPTURE_OPEN_ERROR % device_index)
+            raise IOError(cls.S_CAPTURE_OPEN_ERROR % device_index)
 
         return capture
 
@@ -35,7 +35,7 @@ class Camera(object):
         ret, image = self._device.read()
 
         if not ret:
-            raise IOError(S_CAPTURE_READ_ERROR)
+            raise IOError(self.S_CAPTURE_READ_ERROR)
 
         return Image(image)
 
@@ -81,6 +81,7 @@ class HaarLoader(object):
 
 class HaarNameError(Exception):
     def __init__(self, message):
+        super(HaarNameError, self).__init__()
         self.message = message
     def __str__(self):
         return repr(self.message)
@@ -147,6 +148,7 @@ class FeatureDetector(object):
 
 class FeatureNotFoundException(Exception):
     def __init__(self, message):
+        super(FeatureNotFoundException, self).__init__()
         self.message = message
     def __str__(self):
         return repr(self.message)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]