Skip to content

Commit e2ba89f

Browse files
authored
Merge pull request kivy#1039 from debauchery1st/master
Recipe for websocket-client
2 parents 1e6461a + ffdf43b commit e2ba89f

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from pythonforandroid.toolchain import Recipe
2+
3+
# if android app crashes on start with "ImportError: No module named websocket"
4+
#
5+
# copy the 'websocket' directory into your app directory to force inclusion.
6+
#
7+
# see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe
8+
9+
10+
class WebSocketClient(Recipe):
11+
12+
url = 'https://github.com/debauchery1st/websocket-client/raw/master/websocket_client-0.40.0.tar.gz'
13+
14+
version = '0.40.0'
15+
# md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986'
16+
17+
# patches = ['websocket.patch'] # Paths relative to the recipe dir
18+
19+
depends = ['kivy', 'python2', 'android', 'pyjnius',
20+
'cryptography', 'pyasn1', 'pyopenssl']
21+
22+
recipe = WebSocketClient()
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/websocket/_logging.py b/websocket/_logging.py
2+
index 8a5f4a5..cebc23b 100644
3+
--- a/websocket/_logging.py
4+
+++ b/websocket/_logging.py
5+
@@ -19,9 +19,8 @@ Copyright (C) 2010 Hiroki Ohtani(liris)
6+
Boston, MA 02110-1335 USA
7+
8+
"""
9+
-import logging
10+
-
11+
-_logger = logging.getLogger('websocket')
12+
+from kivy.logger import Logger
13+
+_logger = Logger
14+
_traceEnabled = False
15+
16+
__all__ = ["enableTrace", "dump", "error", "debug", "trace",
17+
@@ -67,8 +66,9 @@ def trace(msg):
18+
19+
20+
def isEnabledForError():
21+
- return _logger.isEnabledFor(logging.ERROR)
22+
+ return True
23+
24+
25+
def isEnabledForDebug():
26+
- return _logger.isEnabledFor(logging.DEBUG)
27+
+ return True
28+
+

0 commit comments

Comments
 (0)