Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
pylinting :D
Browse files Browse the repository at this point in the history
  • Loading branch information
kunaltyagi committed Nov 19, 2016
1 parent 1d0ae81 commit b68bea9
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/Leap/main.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from leap.leap_start import Leap, LeapListener
from ogl.application import Application
"""
Demo application for 3D CAD
"""

class Gesture():
from Leap.leap.leap_start import Leap as OrigLeap
from Leap.leap.leap_start import LeapListener
from Leap.ogl.application import Application


class Gesture(object):
"""
Identifies and stores gesture data
"""

def __init__(self, name='no_gesture', details={}):
def __init__(self, name='no_gesture', details=None):
self.type = name
self.parameters = details
self.parameters = details if details else dict()
self.app = None

def update_gesture(self, gesture_name, details=None):
"""
Expand All @@ -22,13 +28,17 @@ def update_gesture(self, gesture_name, details=None):
self.parameters.update(details)

def add_application(self, app):
"""
Add the application which this gesture is to be passed onto
"""
self.app = app

def gesture_data(self):
"""
Sends details of gesture as a dictionary
"""
self.app.leap_gesture(self)
if self.app is not None:
self.app.leap_gesture(self)


def main():
Expand All @@ -43,20 +53,20 @@ def main():
listener = LeapListener()
listener.add_gesture(gestures)

controller = Leap.Controller()
controller = OrigLeap.Controller()
controller.add_listener(listener)

gl_app.cleanup = lambda: controller.remove_listener(listener)

print("Press ESC to quit")
print("Press ESC to quit") # pylint: disable=superfluous-parens
gl_app.main_loop()
# try:
# sys.stdin.readline()
# except KeyboardInterrupt:
# pass
# finally:
# controller.remove_listener(listener)
print("Thank you for trying our program")
print("Thank you for trying our program") # pylint: disable=superfluous-parens

if __name__ == '__main__':
main()

0 comments on commit b68bea9

Please sign in to comment.