Browse Source

Applied pyflakes and pep8.

Taddeus Kroes 13 năm trước cách đây
mục cha
commit
1868317723
6 tập tin đã thay đổi với 7 bổ sung13 xóa
  1. 0 1
      src/old/MultitouchInteractor.py
  2. 2 4
      src/old/draw.py
  3. 2 4
      src/old/touch.py
  4. 1 2
      src/trackers/basic.py
  5. 1 1
      src/trackers/tap.py
  6. 1 1
      src/window.py

+ 0 - 1
src/old/MultitouchInteractor.py

@@ -1,6 +1,5 @@
 import vtk
 from math import degrees
-from threading import Thread
 
 from objreader import read_obj
 from touch import MultitouchServer

+ 2 - 4
src/old/draw.py

@@ -1,12 +1,9 @@
 #!/usr/bin/env python
 import pygame
 import sys
-import time
 from touch import MultitouchServer, screen_size
 from math import degrees, cos, sin
 
-from events import Rotate
-
 pygame.init()
 
 FULLSCREEN = '-f' in sys.argv[1:]
@@ -115,7 +112,8 @@ def update():
             end_x = x
             dtap[0] -= BEAM_INCREMENT
 
-        pygame.draw.line(screen, BEAM_COLOR, (start_x, y), (end_x, y), BEAM_WIDTH)
+        pygame.draw.line(screen, BEAM_COLOR, (start_x, y), (end_x, y),
+                         BEAM_WIDTH)
 
     # Update canvas
     pygame.display.flip()

+ 2 - 4
src/old/touch.py

@@ -7,9 +7,8 @@ from threading import Thread
 from screen import screen_size
 from tuio_server import TuioServer2D
 from logger import Logger
-from events import Event, DownEvent, UpEvent, MoveEvent, Tap, \
-        SingleTap, DoubleTap, Flick, Rotate, Pinch, \
-        Pan
+from events import Event, DownEvent, UpEvent, MoveEvent, Tap, SingleTap, \
+        DoubleTap, Rotate, Pinch, Pan
 
 # Heuristic constants
 # TODO: Encapsulate screen resolution in distance heuristics
@@ -251,7 +250,6 @@ class MultitouchServer(Logger):
             # There are no touch points, move the centroid out of the screen
             self.centroid = -1., -1.
 
-
     def centroid_movement(self):
         cx, cy = self.centroid
         ocx, ocy = self.old_centroid

+ 1 - 2
src/trackers/basic.py

@@ -1,5 +1,4 @@
-from ..tracker import GestureTracker, Gesture
-from ..geometry import Positionable
+from ..tracker import GestureTracker
 from utils import PointGesture
 
 

+ 1 - 1
src/trackers/tap.py

@@ -1,7 +1,7 @@
 import time
 from threading import Thread
 
-from ..tracker import GestureTracker, Gesture
+from ..tracker import GestureTracker
 from ..geometry import Positionable
 from utils import PointGesture
 

+ 1 - 1
src/window.py

@@ -65,7 +65,7 @@ class CircularWindow(Window, CircularSurface):
     """
     Circular window.
     """
-    def __init__(self, x, y, width, height, **kwargs):
+    def __init__(self, x, y, radius, **kwargs):
         Window.__init__(self, **kwargs)
         CircularSurface.__init__(self, x, y, radius)