From efac1d7ac1e863c70858c4619cdcd59e94ed1e1a Mon Sep 17 00:00:00 2001 From: Meet Udeshi Date: Wed, 14 Dec 2016 21:00:46 +0530 Subject: [PATCH] Remove pep8 E265 from all files block comment should start with '# ' sed rocks! --- examples/3Drendering/objloader.py | 12 +++--- examples/camera/main.py | 6 +-- examples/demo/camera_puzzle.py | 2 +- examples/demo/kivycatalog/main.py | 4 +- .../frameworks/twisted/echo_client_app.py | 4 +- examples/svg/main-smaa.py | 4 +- examples/tutorials/pong/main.py | 6 +-- examples/tutorials/pong/steps/step4/main.py | 4 +- examples/tutorials/pong/steps/step5/main.py | 6 +-- examples/widgets/fbowidget.py | 2 +- examples/widgets/sequenced_images/main.py | 18 ++++---- .../sequenced_images/uix/custom_button.py | 10 ++--- examples/widgets/tabbed_panel_showcase.py | 6 +-- examples/widgets/videoplayer.py | 6 +-- kivy/adapters/listadapter.py | 20 ++++----- kivy/cache.py | 6 +-- kivy/config.py | 2 +- kivy/core/audio/__init__.py | 2 +- kivy/core/camera/__init__.py | 2 +- kivy/core/camera/camera_opencv.py | 2 +- kivy/core/clipboard/clipboard_android.py | 2 +- kivy/core/image/__init__.py | 4 +- kivy/core/image/img_gif.py | 42 +++++++++---------- kivy/core/image/img_pygame.py | 2 +- kivy/core/video/__init__.py | 2 +- kivy/core/video/video_ffpyplayer.py | 2 +- kivy/core/video/video_gi.py | 2 +- kivy/core/video/video_pyglet.py | 8 ++-- kivy/core/video/video_pygst.py | 2 +- kivy/core/window/window_pygame.py | 2 +- kivy/core/window/window_sdl2.py | 10 ++--- kivy/input/providers/leapfinger.py | 2 +- kivy/interactive.py | 8 ++-- kivy/loader.py | 2 +- kivy/logger.py | 2 +- kivy/modules/screen.py | 8 ++-- kivy/tests/common.py | 2 +- kivy/tests/test_fonts.py | 2 +- kivy/tests/test_properties.py | 4 +- kivy/tools/packaging/factory.py | 4 +- kivy/uix/bubble.py | 4 +- kivy/uix/floatlayout.py | 8 ++-- kivy/uix/rst.py | 6 +-- kivy/uix/sandbox.py | 12 +++--- kivy/uix/screenmanager.py | 6 +-- kivy/uix/tabbedpanel.py | 16 +++---- kivy/uix/textinput.py | 16 +++---- kivy/vector.py | 8 ++-- setup.py | 2 +- 49 files changed, 157 insertions(+), 157 deletions(-) diff --git a/examples/3Drendering/objloader.py b/examples/3Drendering/objloader.py index eac2647f8..c30a0db13 100644 --- a/examples/3Drendering/objloader.py +++ b/examples/3Drendering/objloader.py @@ -48,17 +48,17 @@ class ObjFile: norms = f[1] tcs = f[2] for i in range(3): - #get normal components + # get normal components n = (0.0, 0.0, 0.0) if norms[i] != -1: n = self.normals[norms[i] - 1] - #get texture coordinate components + # get texture coordinate components t = (0.0, 0.0) if tcs[i] != -1: t = self.texcoords[tcs[i] - 1] - #get vertex components + # get vertex components v = self.vertices[verts[i] - 1] data = [v[0], v[1], v[2], n[0], n[1], n[2], t[0], t[1]] @@ -69,7 +69,7 @@ class ObjFile: idx += 3 self.objects[self._current_object] = mesh - #mesh.calculate_normals() + # mesh.calculate_normals() self.faces = [] def __init__(self, filename, swapyz=False): @@ -94,9 +94,9 @@ class ObjFile: if values[0] == 'o': self.finish_object() self._current_object = values[1] - #elif values[0] == 'mtllib': + # elif values[0] == 'mtllib': # self.mtl = MTL(values[1]) - #elif values[0] in ('usemtl', 'usemat'): + # elif values[0] in ('usemtl', 'usemat'): # material = values[1] if values[0] == 'v': v = list(map(float, values[1:4])) diff --git a/examples/camera/main.py b/examples/camera/main.py index 129a83e5a..308f2cbff 100644 --- a/examples/camera/main.py +++ b/examples/camera/main.py @@ -10,9 +10,9 @@ throw an exception during the kv language processing. ''' # Uncomment these lines to see all the messages -#from kivy.logger import Logger -#import logging -#Logger.setLevel(logging.TRACE) +# from kivy.logger import Logger +# import logging +# Logger.setLevel(logging.TRACE) from kivy.app import App from kivy.lang import Builder diff --git a/examples/demo/camera_puzzle.py b/examples/demo/camera_puzzle.py index 1558f3419..298d609fa 100644 --- a/examples/demo/camera_puzzle.py +++ b/examples/demo/camera_puzzle.py @@ -44,7 +44,7 @@ class Puzzle(Camera): bx = x * bs by = y * bs subtexture = texture.get_region(bx, by, bs, bs) - #node = PuzzleNode(texture=subtexture, + # node = PuzzleNode(texture=subtexture, # size=(bs, bs), pos=(bx, by)) node = Scatter(pos=(bx, by), size=(bs, bs)) with node.canvas: diff --git a/examples/demo/kivycatalog/main.py b/examples/demo/kivycatalog/main.py index 49df14de1..01395c3fb 100755 --- a/examples/demo/kivycatalog/main.py +++ b/examples/demo/kivycatalog/main.py @@ -34,8 +34,8 @@ from kivy.clock import Clock CATALOG_ROOT = os.path.dirname(__file__) -#Config.set('graphics', 'width', '1024') -#Config.set('graphics', 'height', '768') +# Config.set('graphics', 'width', '1024') +# Config.set('graphics', 'height', '768') '''List of classes that need to be instantiated in the factory from .kv files. ''' diff --git a/examples/frameworks/twisted/echo_client_app.py b/examples/frameworks/twisted/echo_client_app.py index 7e1cb0362..b5a0cb6ae 100644 --- a/examples/frameworks/twisted/echo_client_app.py +++ b/examples/frameworks/twisted/echo_client_app.py @@ -1,9 +1,9 @@ -#install_twisted_rector must be called before importing the reactor +# install_twisted_rector must be called before importing the reactor from kivy.support import install_twisted_reactor install_twisted_reactor() -#A simple Client that send messages to the echo server +# A simple Client that send messages to the echo server from twisted.internet import reactor, protocol diff --git a/examples/svg/main-smaa.py b/examples/svg/main-smaa.py index 455815ed9..529206445 100644 --- a/examples/svg/main-smaa.py +++ b/examples/svg/main-smaa.py @@ -98,8 +98,8 @@ class SvgApp(App): effect.add_widget(wid) if 1: - #from kivy.uix.image import Image - #root.add_widget(Image(source='data/logo/kivy-icon-512.png', + # from kivy.uix.image import Image + # root.add_widget(Image(source='data/logo/kivy-icon-512.png', # size=(800, 600))) filenames = sys.argv[1:] diff --git a/examples/tutorials/pong/main.py b/examples/tutorials/pong/main.py index 752eac893..c007a2406 100644 --- a/examples/tutorials/pong/main.py +++ b/examples/tutorials/pong/main.py @@ -42,15 +42,15 @@ class PongGame(Widget): def update(self, dt): self.ball.move() - #bounce ball off paddles + # bounce ball off paddles self.player1.bounce_ball(self.ball) self.player2.bounce_ball(self.ball) - #bounce ball off bottom or top + # bounce ball off bottom or top if (self.ball.y < self.y) or (self.ball.top > self.top): self.ball.velocity_y *= -1 - #went off a side to score point? + # went off a side to score point? if self.ball.x < self.x: self.player2.score += 1 self.serve_ball(vel=(4, 0)) diff --git a/examples/tutorials/pong/steps/step4/main.py b/examples/tutorials/pong/steps/step4/main.py index febc34b6c..1c45b269e 100644 --- a/examples/tutorials/pong/steps/step4/main.py +++ b/examples/tutorials/pong/steps/step4/main.py @@ -26,11 +26,11 @@ class PongGame(Widget): def update(self, dt): self.ball.move() - #bounce off top and bottom + # bounce off top and bottom if (self.ball.y < 0) or (self.ball.top > self.height): self.ball.velocity_y *= -1 - #bounce off left and right + # bounce off left and right if (self.ball.x < 0) or (self.ball.right > self.width): self.ball.velocity_x *= -1 diff --git a/examples/tutorials/pong/steps/step5/main.py b/examples/tutorials/pong/steps/step5/main.py index 9bcaf53f7..a5a138e00 100644 --- a/examples/tutorials/pong/steps/step5/main.py +++ b/examples/tutorials/pong/steps/step5/main.py @@ -39,15 +39,15 @@ class PongGame(Widget): def update(self, dt): self.ball.move() - #bounce of paddles + # bounce of paddles self.player1.bounce_ball(self.ball) self.player2.bounce_ball(self.ball) - #bounce ball off bottom or top + # bounce ball off bottom or top if (self.ball.y < self.y) or (self.ball.top > self.top): self.ball.velocity_y *= -1 - #went of to a side to score point? + # went of to a side to score point? if self.ball.x < self.x: self.player2.score += 1 self.serve_ball(vel=(4, 0)) diff --git a/examples/widgets/fbowidget.py b/examples/widgets/fbowidget.py index 01bb0fd34..898463fd5 100644 --- a/examples/widgets/fbowidget.py +++ b/examples/widgets/fbowidget.py @@ -90,7 +90,7 @@ if __name__ == '__main__': # test with FboFloatLayout or FloatLayout # comment/uncomment to test it root = FboFloatLayout() - #root = FloatLayout() + # root = FloatLayout() # this part of creation can be slow. try to optimize the loop a # little bit. diff --git a/examples/widgets/sequenced_images/main.py b/examples/widgets/sequenced_images/main.py index c97029531..dcc3a0f4d 100644 --- a/examples/widgets/sequenced_images/main.py +++ b/examples/widgets/sequenced_images/main.py @@ -55,13 +55,13 @@ class mainclass(FloatLayout): # initialize variables self.sign = .10 - #setup Layouts + # setup Layouts layout = GridLayout(size_hint=(1, 1), cols=3, rows=1) left_frame = GridLayout(size_hint=(.25, 1), cols=1) client_frame = FloatLayout(size_hint=(1, 1)) self.right_frame = Right_Frame() - #setup buttons in left frame + # setup buttons in left frame but_load_gif = AnimatedButton(text='load gif', halign='center') but_load_zip_png = AnimatedButton(text='load zipped\n png/s', halign='center') @@ -84,7 +84,7 @@ class mainclass(FloatLayout): background_normal='data/images/info.png', background_down='data/images/info.zip', halign='center') - #Handle button press/release + # Handle button press/release def load_images(*l): if l[0].text == 'load gif' or l[0].text == 'load gif\n from cache': l[0].text = 'load gif\n from cache' @@ -100,19 +100,19 @@ class mainclass(FloatLayout): client_frame.add_widget(sctr, 1) - #position scatter + # position scatter sctr.pos = (240 + self.sign, 200 + self.sign) self.sign += 10 if self.sign > 200: self.sign = 10 sctr.pos = (300, 200 - self.sign) - #bind function on on_release + # bind function on on_release but_load_gif.bind(on_release=load_images) but_load_zip_png.bind(on_release=load_images) but_load_zip_jpg.bind(on_release=load_images) - #add widgets to left frame + # add widgets to left frame left_frame.add_widget(but_load_gif) left_frame.add_widget(but_load_zip_png) left_frame.add_widget(but_load_zip_jpg) @@ -121,16 +121,16 @@ class mainclass(FloatLayout): left_frame.add_widget(but_animated_borderless) left_frame.add_widget(but_animated_bordered) - #set/remove border for borderless widgets (16,16,16,16) by default + # set/remove border for borderless widgets (16,16,16,16) by default but_animated_normal.border = \ but_animated_borderless.border = (0, 0, 0, 0) - #add widgets to the main layout + # add widgets to the main layout layout.add_widget(left_frame) layout.add_widget(client_frame) layout.add_widget(self.right_frame) - #add main layout to root + # add main layout to root self.add_widget(layout) def on_currentObj(self, *l): diff --git a/examples/widgets/sequenced_images/uix/custom_button.py b/examples/widgets/sequenced_images/uix/custom_button.py index 7e3e1b2bb..56ff4cd71 100644 --- a/examples/widgets/sequenced_images/uix/custom_button.py +++ b/examples/widgets/sequenced_images/uix/custom_button.py @@ -27,26 +27,26 @@ class AnimatedButton(Label): self.register_event_type('on_press') self.register_event_type('on_release') - #borderImage.border by default is ... + # borderImage.border by default is ... self.border = (16, 16, 16, 16) - #Image to display depending on state + # Image to display depending on state self.img = Image( source=self.background_normal, allow_stretch=self.allow_stretch, keep_ratio=self.keep_ratio, mipmap=True) - #reset animation if anim_delay is changed + # reset animation if anim_delay is changed def anim_reset(*l): self.img.anim_delay = self.anim_delay self.bind(anim_delay=anim_reset) self.anim_delay = .1 - #update self.texture when image.texture changes + # update self.texture when image.texture changes self.img.bind(texture=self.on_tex_changed) self.on_tex_changed() - #update image source when background image is changed + # update image source when background image is changed def background_changed(*l): self.img.source = self.background_normal self.anim_delay = .1 diff --git a/examples/widgets/tabbed_panel_showcase.py b/examples/widgets/tabbed_panel_showcase.py index 9b3ad883e..18bc6af20 100644 --- a/examples/widgets/tabbed_panel_showcase.py +++ b/examples/widgets/tabbed_panel_showcase.py @@ -56,7 +56,7 @@ Builder.load_string(''' size_hint: (.45, .45) pos_hint: {'center_x': .25, 'y': .55} - #replace the default tab with our custom tab class + # replace the default tab with our custom tab class default_tab_cls: sh.__class__ do_default_tab: True default_tab_content: default_content.__self__ @@ -117,7 +117,7 @@ Builder.load_string(''' pos_hint: {'center_x': .75, 'y': .55} # replace the default tab with our custom tab default_tab: def_tab - #allow variable tab width + # allow variable tab width tab_width: None FloatLayout: RstDocument: @@ -255,7 +255,7 @@ Builder.load_string(''' class Tp(TabbedPanel): - #override tab switching method to animate on tab switch + # override tab switching method to animate on tab switch def switch_to(self, header): anim = Animation(opacity=0, d=.24, t='in_out_quad') diff --git a/examples/widgets/videoplayer.py b/examples/widgets/videoplayer.py index cdd47a11e..4c30804e3 100644 --- a/examples/widgets/videoplayer.py +++ b/examples/widgets/videoplayer.py @@ -6,9 +6,9 @@ from os.path import dirname, join from kivy.app import App from kivy.uix.videoplayer import VideoPlayer -#check what formats are supported for your targeted devices -#for example try h264 video and acc audo for android using an mp4 -#container +# check what formats are supported for your targeted devices +# for example try h264 video and acc audo for android using an mp4 +# container class VideoPlayerApp(App): diff --git a/kivy/adapters/listadapter.py b/kivy/adapters/listadapter.py index d2c1b052c..01256a014 100644 --- a/kivy/adapters/listadapter.py +++ b/kivy/adapters/listadapter.py @@ -345,11 +345,11 @@ class ListAdapter(Adapter, EventDispatcher): # [TODO] sibling selection for composite items # Needed? Or handled from parent? # (avoid circular, redundant selection) - #if hasattr(view, 'parent') and hasattr(view.parent, 'children'): - #siblings = [child for child in view.parent.children if child != view] - #for sibling in siblings: - #if hasattr(sibling, 'select'): - #sibling.select() + # if hasattr(view, 'parent') and hasattr(view.parent, 'children'): + # siblings = [child for child in view.parent.children if child != view] + # for sibling in siblings: + # if hasattr(sibling, 'select'): + # sibling.select() if self.propagate_selection_to_data: data_item = self.get_data_item(view.index) @@ -381,11 +381,11 @@ class ListAdapter(Adapter, EventDispatcher): # [TODO] sibling deselection for composite items # Needed? Or handled from parent? # (avoid circular, redundant selection) - #if hasattr(view, 'parent') and hasattr(view.parent, 'children'): - #siblings = [child for child in view.parent.children if child != view] - #for sibling in siblings: - #if hasattr(sibling, 'deselect'): - #sibling.deselect() + # if hasattr(view, 'parent') and hasattr(view.parent, 'children'): + # siblings = [child for child in view.parent.children if child != view] + # for sibling in siblings: + # if hasattr(sibling, 'deselect'): + # sibling.deselect() if self.propagate_selection_to_data: item = self.get_data_item(view.index) diff --git a/kivy/cache.py b/kivy/cache.py index 09f23c518..12dae42e3 100644 --- a/kivy/cache.py +++ b/kivy/cache.py @@ -75,7 +75,7 @@ class Cache(object): Time after which to delete the object if it has not been used. If None, no timeout is applied. ''' - #check whether obj should not be cached first + # check whether obj should not be cached first if getattr(obj, '_no_cache', False): return try: @@ -85,8 +85,8 @@ class Cache(object): return timeout = timeout or cat['timeout'] # FIXME: activate purge when limit is hit - #limit = cat['limit'] - #if limit is not None and len(Cache._objects[category]) >= limit: + # limit = cat['limit'] + # if limit is not None and len(Cache._objects[category]) >= limit: # Cache._purge_oldest(category) Cache._objects[category][key] = { 'object': obj, diff --git a/kivy/config.py b/kivy/config.py index 639ddff53..cf68371f8 100644 --- a/kivy/config.py +++ b/kivy/config.py @@ -406,7 +406,7 @@ class ConfigParser(PythonConfigParser, object): # a str() conversion -> fail. # Instead we currently to the conversion to utf-8 when value are # "get()", but we internally store them in ascii. - #with codecs.open(filename, 'r', encoding='utf-8') as f: + # with codecs.open(filename, 'r', encoding='utf-8') as f: # self.readfp(f) old_vals = {sect: {k: v for k, v in self.items(sect)} for sect in self.sections()} diff --git a/kivy/core/audio/__init__.py b/kivy/core/audio/__init__.py index a7fd3e6bd..ecdf1a390 100644 --- a/kivy/core/audio/__init__.py +++ b/kivy/core/audio/__init__.py @@ -224,7 +224,7 @@ try: from kivy.lib.gstplayer import GstPlayer # NOQA audio_libs += [('gstplayer', 'audio_gstplayer')] except ImportError: - #audio_libs += [('gi', 'audio_gi')] + # audio_libs += [('gi', 'audio_gi')] if PY2: audio_libs += [('pygst', 'audio_pygst')] audio_libs += [('ffpyplayer', 'audio_ffpyplayer')] diff --git a/kivy/core/camera/__init__.py b/kivy/core/camera/__init__.py index 511873348..b7929e540 100644 --- a/kivy/core/camera/__init__.py +++ b/kivy/core/camera/__init__.py @@ -141,7 +141,7 @@ elif platform == 'macosx': elif platform == 'android': providers += (('android', 'camera_android', 'CameraAndroid'), ) else: - #providers += (('gi', 'camera_gi', 'CameraGi'), ) + # providers += (('gi', 'camera_gi', 'CameraGi'), ) providers += (('pygst', 'camera_pygst', 'CameraPyGst'), ) providers += (('opencv', 'camera_opencv', 'CameraOpenCV'), ) diff --git a/kivy/core/camera/camera_opencv.py b/kivy/core/camera/camera_opencv.py index e52001cdf..aff9df480 100644 --- a/kivy/core/camera/camera_opencv.py +++ b/kivy/core/camera/camera_opencv.py @@ -66,7 +66,7 @@ class CameraOpenCV(CameraBase): # frame). self._resolution = (int(frame.width), int(frame.height)) - #get fps + # get fps self.fps = cv.GetCaptureProperty(self._device, cv.CV_CAP_PROP_FPS) if self.fps <= 0: self.fps = 1 / 30. diff --git a/kivy/core/clipboard/clipboard_android.py b/kivy/core/clipboard/clipboard_android.py index d37c42109..f6bef17c5 100644 --- a/kivy/core/clipboard/clipboard_android.py +++ b/kivy/core/clipboard/clipboard_android.py @@ -80,7 +80,7 @@ class ClipboardAndroid(ClipboardBase): clippy = PythonActivity._clipboard if sdk < 11: - #versions previous to honeycomb + # versions previous to honeycomb clippy.setText(AndroidString(data)) else: ClipData = autoclass('android.content.ClipData') diff --git a/kivy/core/image/__init__.py b/kivy/core/image/__init__.py index a339dd451..b91a0b1ca 100644 --- a/kivy/core/image/__init__.py +++ b/kivy/core/image/__init__.py @@ -327,7 +327,7 @@ class ImageLoader(object): image = None for zfilename in znamelist: try: - #read file and store it in mem with fileIO struct around it + # read file and store it in mem with fileIO struct around it tmpfile = BytesIO(z.read(zfilename)) ext = zfilename.split('.')[-1].lower() im = None @@ -349,7 +349,7 @@ class ImageLoader(object): # overwritten image_data.append(im._data[0]) image = im - #else: if not image file skip to next + # else: if not image file skip to next except: Logger.warning('Image: Unable to load image' '<%s> in zip <%s> trying to continue...' diff --git a/kivy/core/image/img_gif.py b/kivy/core/image/img_gif.py index 833c3d3cf..db42921cf 100644 --- a/kivy/core/image/img_gif.py +++ b/kivy/core/image/img_gif.py @@ -1,4 +1,4 @@ -#-*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # # this program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,8 +27,8 @@ http://www.java2s.com/Open-Source/Python/Network/\ emesene/emesene-1.6.2/pygif/pygif.py.htm''' -#TODO issues to fix -#optimize for speed #partially done# a lot of room for improvement +# TODO issues to fix +# optimize for speed #partially done# a lot of room for improvement import struct from array import array @@ -73,7 +73,7 @@ class ImageLoaderGIF(ImageLoaderBase): else im_palette have_transparent_color = img.has_transparent_color transparent_color = img.transparent_color - #draw_method_restore_previous = 1 \ + # draw_method_restore_previous = 1 \ # if img.draw_method == 'restore previous' else 0 draw_method_replace = 1 \ if ((img.draw_method == 'replace') or @@ -90,7 +90,7 @@ class ImageLoaderGIF(ImageLoaderBase): img_height = ls_height img_width = ls_width left = top = 0 - #reverse top to bottom and left to right + # reverse top to bottom and left to right tmp_top = (ls_height - (img_height + top)) img_width_plus_left = (img_width + left) ls_width_multiply_4 = ls_width * 4 @@ -103,8 +103,8 @@ class ImageLoaderGIF(ImageLoaderBase): rgba_pos = (tmp_top * ls_width_multiply_4) + (left_multiply_4) tmp_top += 1 while i < img_width_plus_left: - #this should now display corrupted gif's - #instead of crashing on gif's not decoded properly + # this should now display corrupted gif's + # instead of crashing on gif's not decoded properly try: (r, g, b) = palette[pixels[x + i]] except: @@ -116,17 +116,17 @@ class ImageLoaderGIF(ImageLoaderBase): if have_transparent_color: if transparent_color == pixels[x + i]: if draw_method_replace: - #transparent pixel draw method replace + # transparent pixel draw method replace pixel_map[rgba_pos + 3] = 0 rgba_pos += 4 i += 1 continue - #transparent pixel draw method combine + # transparent pixel draw method combine rgba_pos += 4 i += 1 continue # this pixel isn't transparent - #doesn't have transparent color + # doesn't have transparent color (pixel_map[rgba_pos], pixel_map[rgba_pos + 1], pixel_map[rgba_pos + 2]) = (r, g, b) pixel_map[rgba_pos + 3] = 255 @@ -154,9 +154,9 @@ class Gif(object): # struct format strings - #17,18: + # 17,18: FMT_HEADER = '<6sHHBBB' - #20: + # 20: FMT_IMGDESC = '') + # Logger.warning(type(filename)('Image: Unable to load image <%s>') # % filename) raise diff --git a/kivy/core/video/__init__.py b/kivy/core/video/__init__.py index 542825870..048c11060 100644 --- a/kivy/core/video/__init__.py +++ b/kivy/core/video/__init__.py @@ -205,7 +205,7 @@ try: from kivy.lib.gstplayer import GstPlayer # NOQA video_providers += [('gstplayer', 'video_gstplayer', 'VideoGstplayer')] except ImportError: - #video_providers += [('gi', 'video_gi', 'VideoGi')] + # video_providers += [('gi', 'video_gi', 'VideoGi')] if PY2: # if peoples do not have gi, fallback on pygst, only for python2 video_providers += [ diff --git a/kivy/core/video/video_ffpyplayer.py b/kivy/core/video/video_ffpyplayer.py index bcb1f3832..b7367e454 100644 --- a/kivy/core/video/video_ffpyplayer.py +++ b/kivy/core/video/video_ffpyplayer.py @@ -190,7 +190,7 @@ class VideoFFPy(VideoBase): self._texture = Texture.create(size=self._size, colorfmt='rgba') # XXX FIXME - #self.texture.add_reload_observer(self.reload_buffer) + # self.texture.add_reload_observer(self.reload_buffer) self._texture.flip_vertical() self.dispatch('on_load') diff --git a/kivy/core/video/video_gi.py b/kivy/core/video/video_gi.py index 1fbe24a5c..bd3d9a7eb 100644 --- a/kivy/core/video/video_gi.py +++ b/kivy/core/video/video_gi.py @@ -191,7 +191,7 @@ class VideoGi(VideoBase): seek_flags = Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT self._playbin.seek_simple(seek_format, seek_flags, seek_t) - #if pipeline is not playing, we need to pull pre-roll to update frame + # if pipeline is not playing, we need to pull pre-roll to update frame if not self._state == 'playing': with self._buffer_lock: self._buffer = self._appsink.emit('pull-preroll') diff --git a/kivy/core/video/video_pyglet.py b/kivy/core/video/video_pyglet.py index 6ddb91553..903c1ed7d 100644 --- a/kivy/core/video/video_pyglet.py +++ b/kivy/core/video/video_pyglet.py @@ -8,8 +8,8 @@ import pyglet from kivy.core.video import VideoBase -#have to set these before importing pyglet.gl -#otherwise pyglet creates a separate gl context and fails +# have to set these before importing pyglet.gl +# otherwise pyglet creates a separate gl context and fails # on error checks because we use pygame window pyglet.options['shadow_window'] = False pyglet.options['debug_gl'] = False @@ -39,12 +39,12 @@ class VideoPyglet(VideoBase): def load(self): self.unload() # make sure we unload an resources - #load media file and set size of video + # load media file and set size of video self._source = source = pyglet.media.load(self._filename) self._format = source.video_format self.size = (self._format.width, self._format.height) - #load pyglet player and have it play the video we loaded + # load pyglet player and have it play the video we loaded self._player = None self._player = pyglet.media.Player() self._player.queue(source) diff --git a/kivy/core/video/video_pygst.py b/kivy/core/video/video_pygst.py index 51d711375..ac616cffa 100644 --- a/kivy/core/video/video_pygst.py +++ b/kivy/core/video/video_pygst.py @@ -162,7 +162,7 @@ class VideoPyGst(VideoBase): seek_flags = gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_KEY_UNIT self._playbin.seek_simple(seek_format, seek_flags, seek_t) - #if pipeline is not playing, we need to pull pre-roll to update frame + # if pipeline is not playing, we need to pull pre-roll to update frame if not self._state == 'playing': with self._buffer_lock: self._buffer = self._appsink.emit('pull-preroll') diff --git a/kivy/core/window/window_pygame.py b/kivy/core/window/window_pygame.py index 1cd32977e..5b690b603 100644 --- a/kivy/core/window/window_pygame.py +++ b/kivy/core/window/window_pygame.py @@ -154,7 +154,7 @@ class WindowPygame(WindowBase): info = pygame.display.Info() self._size = (info.current_w, info.current_h) - #self.dispatch('on_resize', *self._size) + # self.dispatch('on_resize', *self._size) # in order to debug futur issue with pygame/display, let's show # more debug output. diff --git a/kivy/core/window/window_sdl2.py b/kivy/core/window/window_sdl2.py index dce7c693d..2a5674891 100644 --- a/kivy/core/window/window_sdl2.py +++ b/kivy/core/window/window_sdl2.py @@ -466,9 +466,9 @@ class WindowSDL(WindowBase): self._mouse_meta = self.modifiers self._mouse_btn = btn - #times = x if y == 0 else y - #times = min(abs(times), 100) - #for k in range(times): + # times = x if y == 0 else y + # times = min(abs(times), 100) + # for k in range(times): self._mouse_down = True self.dispatch('on_mouse_down', self._mouse_x, self._mouse_y, btn, self.modifiers) @@ -562,7 +562,7 @@ class WindowSDL(WindowBase): kstr = unichr(key) except ValueError: pass - #if 'shift' in self._modifiers and key\ + # if 'shift' in self._modifiers and key\ # not in self.command_keys.keys(): # return @@ -630,7 +630,7 @@ class WindowSDL(WindowBase): def mainloop(self): # don't known why, but pygame required a resize event # for opengl, before mainloop... window reinit ? - #self.dispatch('on_resize', *self.size) + # self.dispatch('on_resize', *self.size) while not EventLoop.quit and EventLoop.status == 'started': try: diff --git a/kivy/input/providers/leapfinger.py b/kivy/input/providers/leapfinger.py index 517b2c175..036c81efe 100644 --- a/kivy/input/providers/leapfinger.py +++ b/kivy/input/providers/leapfinger.py @@ -85,7 +85,7 @@ class LeapFingerEventProvider(MotionEventProvider): available_uid = [] for hand in frame.hands: for finger in hand.fingers: - #print hand.id(), finger.id(), finger.tip() + # print hand.id(), finger.id(), finger.tip() uid = '{0}:{1}'.format(hand.id, finger.id) available_uid.append(uid) position = finger.tip_position diff --git a/kivy/interactive.py b/kivy/interactive.py index c6fa13dea..7332b764c 100644 --- a/kivy/interactive.py +++ b/kivy/interactive.py @@ -215,7 +215,7 @@ class SafeMembrane(object): # methods that make calls against _ref and threadsafe whenever data will be # written to or if a method will be called. SafeMembrane instances should # be unwrapped whenever passing them into the thread - #use type() to determine if an object is a SafeMembrane while debugging + # use type() to determine if an object is a SafeMembrane while debugging def __repr__(self): return self._ref.__repr__() @@ -322,14 +322,14 @@ class InteractiveLauncher(SafeMembrane): def run(self): self.thread.start() - #Proxy behavior starts after this is set. Before this point, attaching - #widgets etc can only be done through the Launcher's app attribute + # Proxy behavior starts after this is set. Before this point, attaching + # widgets etc can only be done through the Launcher's app attribute self._ref = self.app def stop(self): EventLoop.quit = True self.thread.join() - #Act like the app instance even before _ref is set + # Act like the app instance even before _ref is set def __repr__(self): return self.app.__repr__() diff --git a/kivy/loader.py b/kivy/loader.py index d16e93758..cd90bae1a 100755 --- a/kivy/loader.py +++ b/kivy/loader.py @@ -260,7 +260,7 @@ class LoaderBase(object): try: proto = filename.split(':', 1)[0] except: - #if blank filename then return + # if blank filename then return return if load_callback is not None: data = load_callback(filename) diff --git a/kivy/logger.py b/kivy/logger.py index 08147f4ec..59485152f 100644 --- a/kivy/logger.py +++ b/kivy/logger.py @@ -67,7 +67,7 @@ Logger = None BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = list(range(8)) -#These are the sequences need to get colored ouput +# These are the sequences need to get colored ouput RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" diff --git a/kivy/modules/screen.py b/kivy/modules/screen.py index ef7fdc143..4d7042219 100644 --- a/kivy/modules/screen.py +++ b/kivy/modules/screen.py @@ -54,10 +54,10 @@ devices = { 'nexus7': ('Nexus 7 (2012 version)', 1280, 800, 216, 1.325), 'nexus7.2': ('Nexus 7 (2013 version)', 1920, 1200, 323, 2), - #taken from design.google.com/devices - #please consider using another data instead of - #a dict for autocompletion to work - #these are all in landscape + # taken from design.google.com/devices + # please consider using another data instead of + # a dict for autocompletion to work + # these are all in landscape 'phone_android_one': ('Android One', 854, 480, 218, 1.5), 'phone_htc_one_m8': ('HTC One M8', 1920, 1080, 432, 3.0), 'phone_htc_one_m9': ('HTC One M9', 1920, 1080, 432, 3.0), diff --git a/kivy/tests/common.py b/kivy/tests/common.py index 78d76587c..cf8be4438 100644 --- a/kivy/tests/common.py +++ b/kivy/tests/common.py @@ -94,7 +94,7 @@ class GraphicUnitTest(_base): from shutil import move, copy # don't save screenshot until we have enough frames. - #log.debug('framecount %d' % self.framecount) + # log.debug('framecount %d' % self.framecount) self.framecount -= 1 if self.framecount > 0: return diff --git a/kivy/tests/test_fonts.py b/kivy/tests/test_fonts.py index ddb2379a5..dd70fcd62 100644 --- a/kivy/tests/test_fonts.py +++ b/kivy/tests/test_fonts.py @@ -1,4 +1,4 @@ -#-*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import unittest diff --git a/kivy/tests/test_properties.py b/kivy/tests/test_properties.py index 9e03b6d12..320422653 100644 --- a/kivy/tests/test_properties.py +++ b/kivy/tests/test_properties.py @@ -90,10 +90,10 @@ class PropertiesTestCase(unittest.TestCase): a.set(wid, 99) self.assertEqual(a.get(wid), 99) - #try: + # try: # a.set(wid, '') # string shouldn't be accepted # self.fail('number accept string, fail.') - #except ValueError: + # except ValueError: # pass def test_listcheck(self): diff --git a/kivy/tools/packaging/factory.py b/kivy/tools/packaging/factory.py index e856b66d2..779ae5ec0 100644 --- a/kivy/tools/packaging/factory.py +++ b/kivy/tools/packaging/factory.py @@ -55,13 +55,13 @@ class FactoryBuild(Command): ignore = True break if ignore: - #print('<<< ignored (ignore list)') + # print('<<< ignored (ignore list)') continue # special case, core providers if root.startswith('kivy.core.'): if not root.endswith('__init__.py'): - #print('<<< ignored (not a __init__.py)') + # print('<<< ignored (not a __init__.py)') continue print('>>>', module, '::', end=' ') diff --git a/kivy/uix/bubble.py b/kivy/uix/bubble.py index 31354e06e..f12b495ee 100644 --- a/kivy/uix/bubble.py +++ b/kivy/uix/bubble.py @@ -308,7 +308,7 @@ class Bubble(GridLayout): if self_arrow_pos == 'bottom_left': arrow_list = (self_arrow_img, Widget(), Widget()) elif self_arrow_pos == 'bottom_right': - #add two dummy widgets + # add two dummy widgets arrow_list = (Widget(), Widget(), self_arrow_img) widget_list = (self_content, self_arrow_layout) else: @@ -320,7 +320,7 @@ class Bubble(GridLayout): size=self_arrow_img.size) sctr.add_widget(self_arrow_img) if self_arrow_pos == 'top_mid': - #add two dummy widgets + # add two dummy widgets arrow_list = (Widget(), sctr, Widget()) elif self_arrow_pos == 'top_left': arrow_list = (sctr, Widget(), Widget()) diff --git a/kivy/uix/floatlayout.py b/kivy/uix/floatlayout.py index 918e1ab5f..9e35b9a53 100644 --- a/kivy/uix/floatlayout.py +++ b/kivy/uix/floatlayout.py @@ -133,16 +133,16 @@ class FloatLayout(Layout): def add_widget(self, widget, index=0): widget.bind( - #size=self._trigger_layout, - #size_hint=self._trigger_layout, + # size=self._trigger_layout, + # size_hint=self._trigger_layout, pos=self._trigger_layout, pos_hint=self._trigger_layout) return super(FloatLayout, self).add_widget(widget, index) def remove_widget(self, widget): widget.unbind( - #size=self._trigger_layout, - #size_hint=self._trigger_layout, + # size=self._trigger_layout, + # size_hint=self._trigger_layout, pos=self._trigger_layout, pos_hint=self._trigger_layout) return super(FloatLayout, self).remove_widget(widget) diff --git a/kivy/uix/rst.py b/kivy/uix/rst.py index cf140d3a0..78b7af1f9 100644 --- a/kivy/uix/rst.py +++ b/kivy/uix/rst.py @@ -657,11 +657,11 @@ class RstDocument(ScrollView): # get the anchor coordinate inside widget space ax += node.x ay = node.top - ay - #ay += node.y + # ay += node.y # what's the current coordinate for us? sx, sy = self.scatter.x, self.scatter.top - #ax, ay = self.scatter.to_parent(ax, ay) + # ax, ay = self.scatter.to_parent(ax, ay) ay -= self.height @@ -859,7 +859,7 @@ class _Visitor(nodes.NodeVisitor): label = RstTitle(section=self.section, document=self.root) self.current.add_widget(label) self.push(label) - #assert(self.text == '') + # assert(self.text == '') elif cls is nodes.Text: if self.do_strip_text: diff --git a/kivy/uix/sandbox.py b/kivy/uix/sandbox.py index d0555b86d..94a0b8789 100644 --- a/kivy/uix/sandbox.py +++ b/kivy/uix/sandbox.py @@ -135,7 +135,7 @@ class Sandbox(FloatLayout): @sandbox def _clock_sandbox(self, dt): - #import pdb; pdb.set_trace() + # import pdb; pdb.set_trace() Clock.tick() Builder.sync() @@ -155,11 +155,11 @@ if __name__ == '__main__': class TestButton(Button): def on_touch_up(self, touch): - #raise Exception('fdfdfdfdfdfdfd') + # raise Exception('fdfdfdfdfdfdfd') return super(TestButton, self).on_touch_up(touch) def on_touch_down(self, touch): - #raise Exception('') + # raise Exception('') return super(TestButton, self).on_touch_down(touch) s = Sandbox() @@ -181,10 +181,10 @@ if __name__ == '__main__': texture: self.texture # invalid... for testing. - #on_touch_up: root.d() - #on_touch_down: root.f() + # on_touch_up: root.d() + # on_touch_down: root.f() on_release: root.args() - #on_press: root.args() + # on_press: root.args() ''') b = TestButton(text='Hello World') s.add_widget(b) diff --git a/kivy/uix/screenmanager.py b/kivy/uix/screenmanager.py index 2f24f9b04..bcea32d4c 100644 --- a/kivy/uix/screenmanager.py +++ b/kivy/uix/screenmanager.py @@ -1149,9 +1149,9 @@ if __name__ == '__main__': class TestApp(App): def change_view(self, *l): - #d = ('left', 'up', 'down', 'right') - #di = d.index(self.sm.transition.direction) - #self.sm.transition.direction = d[(di + 1) % len(d)] + # d = ('left', 'up', 'down', 'right') + # di = d.index(self.sm.transition.direction) + # self.sm.transition.direction = d[(di + 1) % len(d)] self.sm.current = next(self.sm) def remove_screen(self, *l): diff --git a/kivy/uix/tabbedpanel.py b/kivy/uix/tabbedpanel.py index 3b70059cd..134615d0e 100644 --- a/kivy/uix/tabbedpanel.py +++ b/kivy/uix/tabbedpanel.py @@ -163,7 +163,7 @@ class TabbedPanelHeader(ToggleButton): # only allow selecting the tab if not already selected def on_touch_down(self, touch): if self.state == 'down': - #dispatch to children, not to self + # dispatch to children, not to self for child in self.children: child.dispatch('on_touch_down', touch) return @@ -723,7 +723,7 @@ class TabbedPanel(GridLayout): if tab_pos == 'bottom_left': tab_list = (scrl_v, Widget(), Widget()) elif tab_pos == 'bottom_right': - #add two dummy widgets + # add two dummy widgets tab_list = (Widget(), Widget(), scrl_v) widget_list = (self_content, tab_layout) else: @@ -772,11 +772,11 @@ class TabbedPanel(GridLayout): # fine but touch won't translate to the correct position if tab_pos[lentab_pos - 4:] == '_top': - #on positions 'left_top' and 'right_top' + # on positions 'left_top' and 'right_top' sctr.bind(pos=partial(self._update_top, sctr, 'top', None)) tab_list = (sctr, ) elif tab_pos[lentab_pos - 4:] == '_mid': - #calculate top of scatter + # calculate top of scatter sctr.bind(pos=partial(self._update_top, sctr, 'mid', scrl_v.width)) tab_list = (Widget(), sctr, Widget()) @@ -810,7 +810,7 @@ class TabbedPanel(GridLayout): if tab.size_hint_x: # size_hint_x: x/.xyz tab.size_hint_x = 1 - #drop to default tab_width + # drop to default tab_width tsw += 100 else: # size_hint_x: None @@ -837,10 +837,10 @@ class TabbedPanel(GridLayout): self_tab_pos = self.tab_pos self_tabs = self._tab_strip if self_tab_pos[0] == 'b' or self_tab_pos[0] == 't': - #bottom or top + # bottom or top scrl_v.width = min(self.width, self_tabs.width) - #required for situations when scrl_v's pos is calculated - #when it has no parent + # required for situations when scrl_v's pos is calculated + # when it has no parent scrl_v.top += 1 scrl_v.top -= 1 else: diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index 636c97f76..fecee40f3 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -861,7 +861,7 @@ class TextInput(FocusBehavior, Widget): self._delete_line(cr) start = cr - 1 else: - #ch = text[cc-1] + # ch = text[cc-1] substring = text[cc - 1] new_text = text[:cc - 1] + text[cc:] self._set_line_text(cr, new_text) @@ -888,7 +888,7 @@ class TextInput(FocusBehavior, Widget): self._undo.append({ 'undo_command': ('bkspc', new_index, substring), 'redo_command': ol_index}) - #reset redo when undo is appended to + # reset redo when undo is appended to self._redo = [] _re_whitespace = re.compile(r'\s+') @@ -1257,7 +1257,7 @@ class TextInput(FocusBehavior, Widget): # allows smoother scrolling, noticeably # faster when dealing with large text. self._update_graphics_selection() - #self._trigger_update_graphics() + # self._trigger_update_graphics() # # Touch control @@ -1806,7 +1806,7 @@ class TextInput(FocusBehavior, Widget): mode = 'all' if len(largs) > 1: mode, start, finish, _lines, _lines_flags, len_lines = largs - #start = max(0, start) + # start = max(0, start) cursor = None else: cursor = self.cursor_index() @@ -1841,7 +1841,7 @@ class TextInput(FocusBehavior, Widget): min_line_ht = self._label_cached.get_extents('_')[1] # with markup texture can be of height `1` self.line_height = max(_lines_labels[0].height, min_line_ht) - #self.line_spacing = 2 + # self.line_spacing = 2 # now, if the text change, maybe the cursor is not at the same place as # before. so, try to set the cursor on the good place row = self.cursor_row @@ -2290,7 +2290,7 @@ class TextInput(FocusBehavior, Widget): elif internal_action == 'escape': self.focus = False if internal_action != 'escape': - #self._recalc_size() + # self._recalc_size() pass def _key_up(self, key, repeat=False): @@ -2406,7 +2406,7 @@ class TextInput(FocusBehavior, Widget): if self._selection: self.delete_selection() self.insert_text(text) - #self._recalc_size() + # self._recalc_size() return if is_interesting_key: @@ -3148,7 +3148,7 @@ if __name__ == '__main__': root = BoxLayout(orientation='vertical') textinput = TextInput(multiline=True, use_bubble=True, use_handles=True) - #textinput.text = __doc__ + # textinput.text = __doc__ root.add_widget(textinput) textinput2 = TextInput(multiline=False, text='monoline textinput', size_hint=(1, None), height=30) diff --git a/kivy/vector.py b/kivy/vector.py index 7711681f6..206f07627 100644 --- a/kivy/vector.py +++ b/kivy/vector.py @@ -334,7 +334,7 @@ class Vector(list): For math see: http://en.wikipedia.org/wiki/Line-line_intersection ''' - #linear algebar sucks...seriously!! + # linear algebar sucks...seriously!! x1, x2, x3, x4 = float(v1[0]), float(v2[0]), float(v3[0]), float(v4[0]) y1, y2, y3, y4 = float(v1[1]), float(v2[1]), float(v3[1]), float(v4[1]) @@ -369,10 +369,10 @@ class Vector(list): >>> Vector.segment_intersection(a, b, c, d) [5, 5] ''' - #Yaaay! I love linear algebra applied within the realms of geometry. + # Yaaay! I love linear algebra applied within the realms of geometry. x1, x2, x3, x4 = float(v1[0]), float(v2[0]), float(v3[0]), float(v4[0]) y1, y2, y3, y4 = float(v1[1]), float(v2[1]), float(v3[1]), float(v4[1]) - #This is mostly the same as the line_intersection + # This is mostly the same as the line_intersection u = (x1 * y2 - y1 * x2) v = (x3 * y4 - y3 * x4) denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4) @@ -381,7 +381,7 @@ class Vector(list): px = (u * (x3 - x4) - (x1 - x2) * v) / denom py = (u * (y3 - y4) - (y1 - y2) * v) / denom - #Here are the new bits + # Here are the new bits c1 = (x1 <= px <= x2) or (x2 <= px <= x1) c2 = (y1 <= py <= y2) or (y2 <= py <= y1) c3 = (x3 <= px <= x4) or (x4 <= px <= x3) diff --git a/setup.py b/setup.py index a662ad462..a883f867c 100644 --- a/setup.py +++ b/setup.py @@ -823,7 +823,7 @@ if c_options['use_x11']: # cause keytab is included in core, and core is included in # window_x11 # - #'depends': [ + # 'depends': [ # 'core/window/window_x11_keytab.c', # 'core/window/window_x11_core.c'], 'libraries': libs})