mirror of https://github.com/kivy/kivy.git
pep8 fixes
This commit is contained in:
parent
fd952fec10
commit
ea16bd5898
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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.
|
||||
|
||||
'''
|
||||
|
||||
|
|
Loading…
Reference in New Issue