Skip to content

Commit 2e16e67

Browse files
committed
Fixes linting errors in runnable.py
https://travis-ci.org/github/kivy/python-for-android/jobs/668867999 ``` runnable.py:17:1: E302 expected 2 blank lines, found 1 runnable.py:33:1: W293 blank line contains whitespace runnable.py:45:1: W293 blank line contains whitespace runnable.py:46:1: W293 blank line contains whitespace runnable.py:49:1: E303 too many blank lines (4) runnable.py:53:1: W293 blank line contains whitespace runnable.py:55:1: W293 blank line contains whitespace runnable.py:56:32: E261 at least two spaces before inline comment runnable.py:56:33: E262 inline comment should start with '# ' runnable.py:57:1: W293 blank line contains whitespace runnable.py:58:45: E231 missing whitespace after ':' runnable.py:59:1: W293 blank line contains whitespace runnable.py:61:1: W293 blank line contains whitespace runnable.py:64:1: W293 blank line contains whitespace ```
1 parent 0af0ffa commit 2e16e67

File tree

1 file changed

+5
-12
lines changed
  • pythonforandroid/recipes/android/src/android

1 file changed

+5
-12
lines changed

pythonforandroid/recipes/android/src/android/runnable.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'''
22
Runnable
33
========
4-
54
'''
65

76
from jnius import PythonJavaClass, java_method, autoclass
@@ -14,6 +13,7 @@
1413
# is limited, so by caching them we avoid running out.
1514
__functionstable__ = {}
1615

16+
1717
class Runnable(PythonJavaClass):
1818
'''Wrapper around Java Runnable class. This class can be used to schedule a
1919
call of a Python function into the PythonActivity thread.
@@ -30,7 +30,6 @@ def __call__(self, *args, **kwargs):
3030
self.args = args
3131
self.kwargs = kwargs
3232
Runnable.__runnables__.append(self)
33-
3433
_PythonActivity.mActivity.runOnUiThread(self)
3534

3635
@java_method('()V')
@@ -42,24 +41,18 @@ def run(self):
4241
traceback.print_exc()
4342

4443
Runnable.__runnables__.remove(self)
45-
46-
4744

4845

4946
def run_on_ui_thread(f):
5047
'''Decorator to create automatically a :class:`Runnable` object with the
5148
function. The function will be delayed and call into the Activity thread.
5249
'''
53-
5450
if f not in __functionstable__:
55-
56-
rfunction = Runnable(f) #store the runnable function
57-
58-
__functionstable__[f] = {"rfunction":rfunction}
59-
51+
rfunction = Runnable(f) # store the runnable function
52+
__functionstable__[f] = {"rfunction": rfunction}
6053
rfunction = __functionstable__[f]["rfunction"]
61-
54+
6255
def f2(*args, **kwargs):
6356
rfunction(*args, **kwargs)
64-
57+
6558
return f2

0 commit comments

Comments
 (0)