[mousetrap/gnome3-wip: 74/240] De-linting
- From: Heidi Ellis <heidiellis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mousetrap/gnome3-wip: 74/240] De-linting
- Date: Mon, 8 Sep 2014 15:18:46 +0000 (UTC)
commit a697c3200432976309ceaae9e4c37beb45df12cb
Author: Stoney Jackson <dr stoney gmail com>
Date: Wed Jun 11 22:26:49 2014 -0400
De-linting
src/mousetrap/main.py | 4 ++--
src/mousetrap/test_pointer.py | 14 +++++++-------
src/mousetrap/vision.py | 5 +++--
3 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/src/mousetrap/main.py b/src/mousetrap/main.py
index 20b0900..154a95a 100644
--- a/src/mousetrap/main.py
+++ b/src/mousetrap/main.py
@@ -43,10 +43,10 @@ class Main(object):
half_width = screen.get_width() / 2
x_screen = (-1 * (x_screen - half_width)) + half_width
print 'Pointer location in screen:' + \
- str( {'x':x_screen, 'y':y_screen} )
+ str({'x':x_screen, 'y':y_screen})
# move the pointer
- self.pointer.set_position( (x_screen, y_screen) )
+ self.pointer.set_position((x_screen, y_screen))
except Exception as exception:
print exception.args[0]
gui.show_image('diff', self.image)
diff --git a/src/mousetrap/test_pointer.py b/src/mousetrap/test_pointer.py
index f02d11e..861326e 100644
--- a/src/mousetrap/test_pointer.py
+++ b/src/mousetrap/test_pointer.py
@@ -8,18 +8,18 @@ class test_pointer(unittest.TestCase):
self.pointer = pointer.Pointer()
def test_get_position(self):
- x, y = self.pointer.get_position()
+ pointer_x, pointer_y = self.pointer.get_position()
try:
- x += 1
- y += 1
+ pointer_x += 1
+ pointer_y += 1
except TypeError:
- self.assertTrue(False, msg='x or y is not a number')
+ self.assertTrue(False, msg='pointer_x or pointer_y is not a number')
def test_set_position(self):
self.pointer.set_position((3, 4))
- x, y = self.pointer.get_position()
- self.assertEquals(3, x)
- self.assertEquals(4, y)
+ pointer_x, pointer_y = self.pointer.get_position()
+ self.assertEquals(3, pointer_x)
+ self.assertEquals(4, pointer_y)
if __name__ == '__main__':
diff --git a/src/mousetrap/vision.py b/src/mousetrap/vision.py
index 7af3273..c7bbd4a 100644
--- a/src/mousetrap/vision.py
+++ b/src/mousetrap/vision.py
@@ -84,7 +84,7 @@ class HaarLoader(object):
return haar
@staticmethod
- def from_file(file, cache_name=None):
+ def from_file(file_, cache_name=None):
import os
if cache_name in HaarLoader._haar_cache:
@@ -92,7 +92,7 @@ class HaarLoader(object):
current_dir = os.path.dirname(os.path.realpath(__file__))
- haar_file = os.path.join(current_dir, file)
+ haar_file = os.path.join(current_dir, file_)
haar = cv2.CascadeClassifier(haar_file)
@@ -155,6 +155,7 @@ class FeatureDetector(object):
def _exit_if_none_detected(self):
if len(self._plural) == 0:
+ # FIXME: need custom exception
raise Exception('No ' + self._name + 's detected.')
def _unpack_first(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]