pep8 fixes

This commit is contained in:
gabriel.pettier 2012-03-19 19:40:43 +01:00
parent 066e2c7e49
commit d08e980cd2
1 changed files with 8 additions and 7 deletions

View File

@ -74,7 +74,8 @@ Let's say you want to save angle and pressure of the touch, if available::
Or with modules variables:: 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 Known limitations
----------------- -----------------
@ -100,6 +101,7 @@ from kivy.logger import Logger
from ast import literal_eval from ast import literal_eval
from functools import partial from functools import partial
class RecorderMotionEvent(MotionEvent): class RecorderMotionEvent(MotionEvent):
def depack(self, args): def depack(self, args):
@ -191,17 +193,16 @@ class Recorder(EventDispatcher):
(time() - self.record_time, etype, motionevent.uid, args), )) (time() - self.record_time, etype, motionevent.uid, args), ))
self.counter += 1 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: if not self.record:
return return
self.record_fd.write('%r\n' % ( self.record_fd.write('%r\n' % (
(time() - self.record_time, etype, 0, { (time() - self.record_time, etype, 0, {
'key': key, 'key': key,
'scancode': scancode, 'scancode': kwargs.get('scancode'),
'unicode': unicode, 'unicode': kwargs.get('unicode'),
'modifier': modifier, 'modifier': kwargs.get('modifier'),
'is_touch': False 'is_touch': False}), ))
}),))
self.counter += 1 self.counter += 1
def release(self): def release(self):