From d08e980cd249b02200549940efd3e9c6ddb28db7 Mon Sep 17 00:00:00 2001 From: "gabriel.pettier" Date: Mon, 19 Mar 2012 19:40:43 +0100 Subject: [PATCH] pep8 fixes --- kivy/input/recorder.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kivy/input/recorder.py b/kivy/input/recorder.py index bd57f5cb3..0fd5c2acc 100644 --- a/kivy/input/recorder.py +++ b/kivy/input/recorder.py @@ -74,7 +74,8 @@ Let's say you want to save angle and pressure of the touch, if available:: Or with modules variables:: - $ python main.py -m recorder,attrs=is_touch:sx:sy:angle:pressure,profile_mask=pos:angle:pressure + $ python main.py -m recorder,attrs=is_touch:sx:sy:angle:pressure,\ + profile_mask=pos:angle:pressure Known limitations ----------------- @@ -100,6 +101,7 @@ from kivy.logger import Logger from ast import literal_eval from functools import partial + class RecorderMotionEvent(MotionEvent): def depack(self, args): @@ -191,17 +193,16 @@ class Recorder(EventDispatcher): (time() - self.record_time, etype, motionevent.uid, args), )) self.counter += 1 - def on_keyboard(self, etype, window, key, scancode=None, unicode=None, modifier=None): + def on_keyboard(self, etype, window, key, **kwargs): if not self.record: return self.record_fd.write('%r\n' % ( (time() - self.record_time, etype, 0, { 'key': key, - 'scancode': scancode, - 'unicode': unicode, - 'modifier': modifier, - 'is_touch': False - }),)) + 'scancode': kwargs.get('scancode'), + 'unicode': kwargs.get('unicode'), + 'modifier': kwargs.get('modifier'), + 'is_touch': False}), )) self.counter += 1 def release(self):