Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added recorder file
  • Loading branch information
adelinolobao committed Feb 3, 2012
1 parent 8ff0ea1 commit a7164ba
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions recorder.py
@@ -0,0 +1,31 @@
#!/usr/bin/env python
# encoding: utf-8
"""
File: recorder.py
Adelino Lobão
03/02/2012
"""

import sys
import os
import pickle
from pymt import *
from lib.window import WindowApp
from lib.helper import Helper

class RecorderWindowApp(WindowApp):
def on_touch_up(self, touch):
self.gesture.append(touch.userdata['trace'])
if len(getCurrentTouches()) == 0:
templatePath = Helper.returnTemplatePath()
output = open(templatePath, 'wb')
pickle.dump(self.gesture, output)
output.close()
print templatePath + ' saved...'
self.gesture = []

if __name__ == '__main__':
window = MTWindow()
app = RecorderWindowApp()
window.add_widget(app)
runTouchApp()

0 comments on commit a7164ba

Please sign in to comment.