Commit 48fbec2e authored by Taddeüs Kroes's avatar Taddeüs Kroes

Applied pep8.

parent 31a4bae6
...@@ -118,7 +118,8 @@ def update(): ...@@ -118,7 +118,8 @@ def update():
end_x = x end_x = x
dtap[0] -= BEAM_INCREMENT 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 # Update canvas
pygame.display.flip() pygame.display.flip()
...@@ -134,10 +135,12 @@ def rotate(gesture): ...@@ -134,10 +135,12 @@ def rotate(gesture):
global angle global angle
angle += gesture.get_angle() angle += gesture.get_angle()
def pinch(gesture): def pinch(gesture):
global scale global scale
scale = min(scale * gesture.get_scale(), MAX_SCALE) scale = min(scale * gesture.get_scale(), MAX_SCALE)
transform = TransformationTracker(win) transform = TransformationTracker(win)
transform.rotate(rotate) transform.rotate(rotate)
transform.pinch(pinch) transform.pinch(pinch)
......
...@@ -6,14 +6,14 @@ from src.logger import Logger ...@@ -6,14 +6,14 @@ from src.logger import Logger
# Parse arguments # Parse arguments
def create_parser(): def create_parser():
parser = argparse.ArgumentParser(description='Basic test program for usage ' parser = argparse.ArgumentParser(description='Basic test program for '
'of multi-touch API.') 'usage of multi-touch API.')
parser.add_argument('--log', metavar='LOG_LEVEL', default='INFO', parser.add_argument('--log', metavar='LOG_LEVEL', default='INFO',
choices=['DEBUG', 'INFO', 'WARNING'], choices=['DEBUG', 'INFO', 'WARNING'],
help='set log level (defaults to INFO)') help='set log level (defaults to INFO)')
parser.add_argument('--logfile', metavar='FILENAME', parser.add_argument('--logfile', metavar='FILENAME',
help='filename for the log file (the log is printed to ' help='filename for the log file (the log is printed '
'stdout by default)') 'to stdout by default)')
return parser return parser
......
...@@ -18,9 +18,11 @@ win = FullscreenWindow(server=server) ...@@ -18,9 +18,11 @@ win = FullscreenWindow(server=server)
# Add tracker and handlers # Add tracker and handlers
tracker = TapTracker(win) tracker = TapTracker(win)
def handler(gesture): def handler(gesture):
pass pass
tracker.tap(handler) tracker.tap(handler)
tracker.single_tap(handler) tracker.single_tap(handler)
tracker.double_tap(handler) tracker.double_tap(handler)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment