Skip to content

Commit a548330

Browse files
authored
Merge pull request #2114 from AndreMiras/feature/fixes_linting
Fixes linting errors in runnable.py
2 parents 0af0ffa + 2e16e67 commit a548330

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy