From ea16bd589820f2c79e54c42c06ac0affb85a512c Mon Sep 17 00:00:00 2001 From: tshirtman Date: Tue, 2 Oct 2012 00:41:52 +0200 Subject: [PATCH] pep8 fixes --- kivy/input/providers/wm_pen.py | 12 ++++++------ kivy/logger.py | 7 ++++--- kivy/tests/test_urlrequest.py | 8 ++++---- kivy/uix/layout.py | 3 ++- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/kivy/input/providers/wm_pen.py b/kivy/input/providers/wm_pen.py index b6b7702cc..2abdc7ab4 100644 --- a/kivy/input/providers/wm_pen.py +++ b/kivy/input/providers/wm_pen.py @@ -6,10 +6,11 @@ Support of WM_PEN message (Window platform) __all__ = ('WM_PenProvider', 'WM_Pen') import os -from kivy.input.providers.wm_common import (PEN_OR_TOUCH_SIGNATURE, - PEN_OR_TOUCH_MASK, GWL_WNDPROC, WM_MOUSEMOVE, WM_LBUTTONUP, - WM_LBUTTONDOWN, WM_TABLET_QUERYSYSTEMGESTURE, - QUERYSYSTEMGESTURE_WNDPROC, PEN_EVENT_TOUCH_MASK) +from kivy.input.providers.wm_common import ( + PEN_OR_TOUCH_SIGNATURE, PEN_OR_TOUCH_MASK, GWL_WNDPROC, + WM_MOUSEMOVE, WM_LBUTTONUP, WM_LBUTTONDOWN, + WM_TABLET_QUERYSYSTEMGESTURE, QUERYSYSTEMGESTURE_WNDPROC, + PEN_EVENT_TOUCH_MASK) from kivy.input.motionevent import MotionEvent @@ -53,7 +54,6 @@ else: h = property(lambda self: self.bottom - self.top) win_rect = RECT() - if hasattr(windll.user32, 'SetWindowLongPtrW'): windll.user32.SetWindowLongPtrW.restype = WNDPROC windll.user32.SetWindowLongPtrW.argtypes = [HANDLE, c_int, WNDPROC] @@ -110,7 +110,7 @@ else: return 1 else: return windll.user32.CallWindowProcW(self.old_windProc, - hwnd, msg, wParam, lParam) + hwnd, msg, wParam, lParam) def start(self): self.uid = 0 diff --git a/kivy/logger.py b/kivy/logger.py index 232a5f36d..4b6237fce 100644 --- a/kivy/logger.py +++ b/kivy/logger.py @@ -232,8 +232,8 @@ class ColoredFormatter(logging.Formatter): levelname = 'TRACE' record.levelname = levelname if self.use_color and levelname in COLORS: - levelname_color = COLOR_SEQ % (30 + COLORS[levelname]) \ - + levelname + RESET_SEQ + levelname_color = ( + COLOR_SEQ % (30 + COLORS[levelname]) + levelname + RESET_SEQ) record.levelname = levelname_color return logging.Formatter.format(self, record) @@ -272,6 +272,7 @@ class LogFile(object): def flush(self): return + def logger_config_update(section, key, value): if LOG_LEVELS.get(value) is None: raise AttributeError('Loglevel {0!r} doesn\'t exists'.format(value)) @@ -294,7 +295,7 @@ if 'KIVY_NO_CONSOLELOG' not in os.environ: else: use_color = os.name != 'nt' color_fmt = formatter_message( - '[%(levelname)-18s] %(message)s', use_color) + '[%(levelname)-18s] %(message)s', use_color) formatter = ColoredFormatter(color_fmt, use_color=use_color) console = ConsoleHandler() console.setFormatter(formatter) diff --git a/kivy/tests/test_urlrequest.py b/kivy/tests/test_urlrequest.py index 0440adc00..54d1c858e 100644 --- a/kivy/tests/test_urlrequest.py +++ b/kivy/tests/test_urlrequest.py @@ -9,6 +9,7 @@ from kivy.network.urlrequest import UrlRequest from time import sleep from kivy.clock import Clock + class UrlRequestTest(unittest.TestCase): def _on_success(self, req, *args): @@ -20,13 +21,12 @@ class UrlRequestTest(unittest.TestCase): def _on_progress(self, req, *args): self.queue.append((thread.get_ident(), 'progress', args)) - def test_callbacks(self): self.queue = [] req = UrlRequest('http://google.com', - on_success=self._on_success, - on_progress=self._on_progress, - on_error=self._on_error) + on_success=self._on_success, + on_progress=self._on_progress, + on_error=self._on_error) # don't use wait, but maximum 10s timeout for i in xrange(50): diff --git a/kivy/uix/layout.py b/kivy/uix/layout.py index 50c67410e..e7cd68ce1 100644 --- a/kivy/uix/layout.py +++ b/kivy/uix/layout.py @@ -38,7 +38,8 @@ height, do:: widget.width = 250 .. versionchanged:: 1.4.1 - `reposition_child` internal method (made public by mistake) have been removed. + `reposition_child` internal method (made public by mistake) have + been removed. '''