From 94e084ef139bbde89332f4803b5dff23ab7356cc Mon Sep 17 00:00:00 2001 From: debauchery1st Date: Sun, 16 Apr 2017 16:04:45 -0400 Subject: [PATCH 01/12] Recipe for websocket-client --- .../recipes/websocket-client/__init__.py | 12 +++++++ .../recipes/websocket-client/websocket.patch | 33 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 pythonforandroid/recipes/websocket-client/__init__.py create mode 100644 pythonforandroid/recipes/websocket-client/websocket.patch diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py new file mode 100644 index 0000000000..e5d9061286 --- /dev/null +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -0,0 +1,12 @@ +class WebSocketClient(Recipe): + + url = 'https://pypi.python.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz' + version = '0.40.0' + md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986' + + patches = ['websocket.patch'] # Paths relative to the recipe dir + + depends = ['kivy', 'python2', 'android', 'pyjnius', 'backports.ssl-match-hostname', + 'cryptography', 'pyasn1', 'ndg_httpsclient', 'pyopenssl'] + +recipe = WebSocketClient() diff --git a/pythonforandroid/recipes/websocket-client/websocket.patch b/pythonforandroid/recipes/websocket-client/websocket.patch new file mode 100644 index 0000000000..da04b01ba5 --- /dev/null +++ b/pythonforandroid/recipes/websocket-client/websocket.patch @@ -0,0 +1,33 @@ +Binary files websocket/.DS_Store and websocket-patch/.DS_Store differ +diff -ruN websocket/_logging.py websocket-patch/_logging.py +--- websocket/_logging.py 2016-10-02 21:35:05.000000000 -0400 ++++ websocket-patch/_logging.py 2017-04-10 15:01:56.000000000 -0400 +@@ -19,9 +19,10 @@ + Boston, MA 02110-1335 USA + + """ +-import logging +- +-_logger = logging.getLogger('websocket') ++# import logging ++from kivy.logger import Logger ++# _logger = logging.getLogger('websocket') ++_logger = Logger + _traceEnabled = False + + __all__ = ["enableTrace", "dump", "error", "debug", "trace", +@@ -67,8 +68,10 @@ + + + def isEnabledForError(): +- return _logger.isEnabledFor(logging.ERROR) ++ return True ++ # return _logger.isEnabledFor(logging.ERROR) + + + def isEnabledForDebug(): +- return _logger.isEnabledFor(logging.DEBUG) ++ return True ++ # return _logger.isEnabledFor(logging.DEBUG) +Binary files websocket/tests/__init__.pyc and websocket-patch/tests/__init__.pyc differ +Binary files websocket/tests/test_websocket.pyc and websocket-patch/tests/test_websocket.pyc differ From b2297bc74d394531c1db6112bb3a3f0f9890dedb Mon Sep 17 00:00:00 2001 From: debauchery1st Date: Sun, 16 Apr 2017 16:16:29 -0400 Subject: [PATCH 02/12] Recipe for websocket-client --- pythonforandroid/recipes/websocket-client/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index e5d9061286..7814986848 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -1,3 +1,6 @@ +from pythonforandroid.toolchain import Recipe + + class WebSocketClient(Recipe): url = 'https://pypi.python.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz' From 1191d8f609a7d9567225d334de5d874ff9475a03 Mon Sep 17 00:00:00 2001 From: debauchery1st Date: Sun, 16 Apr 2017 16:20:24 -0400 Subject: [PATCH 03/12] Recipe for websocket-client --- pythonforandroid/recipes/websocket-client/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 7814986848..8c4ab9d41b 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -9,7 +9,7 @@ class WebSocketClient(Recipe): patches = ['websocket.patch'] # Paths relative to the recipe dir - depends = ['kivy', 'python2', 'android', 'pyjnius', 'backports.ssl-match-hostname', + depends = ['kivy', 'python2', 'android', 'pyjnius', 'cryptography', 'pyasn1', 'ndg_httpsclient', 'pyopenssl'] recipe = WebSocketClient() From 7850a937b7bc8e2bffa58903b21a06c286d3b990 Mon Sep 17 00:00:00 2001 From: debauchery1st Date: Sun, 16 Apr 2017 16:21:17 -0400 Subject: [PATCH 04/12] Recipe for websocket-client --- pythonforandroid/recipes/websocket-client/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 8c4ab9d41b..984eeff047 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -10,6 +10,6 @@ class WebSocketClient(Recipe): patches = ['websocket.patch'] # Paths relative to the recipe dir depends = ['kivy', 'python2', 'android', 'pyjnius', - 'cryptography', 'pyasn1', 'ndg_httpsclient', 'pyopenssl'] + 'cryptography', 'pyasn1', 'pyopenssl'] recipe = WebSocketClient() From f72769bc45e9547b036a27eba8263461a5bd88b7 Mon Sep 17 00:00:00 2001 From: Trevor Martin Date: Thu, 13 Apr 2017 21:38:51 -0400 Subject: [PATCH 05/12] websocket-client recipe --- .../recipes/websocket-client/websocket.patch | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pythonforandroid/recipes/websocket-client/websocket.patch b/pythonforandroid/recipes/websocket-client/websocket.patch index da04b01ba5..bf34fd4209 100644 --- a/pythonforandroid/recipes/websocket-client/websocket.patch +++ b/pythonforandroid/recipes/websocket-client/websocket.patch @@ -1,7 +1,5 @@ -Binary files websocket/.DS_Store and websocket-patch/.DS_Store differ -diff -ruN websocket/_logging.py websocket-patch/_logging.py ---- websocket/_logging.py 2016-10-02 21:35:05.000000000 -0400 -+++ websocket-patch/_logging.py 2017-04-10 15:01:56.000000000 -0400 +--- a/websocket/_logging.py 2016-10-02 21:35:05.000000000 -0400 ++++ b/websocket/_logging.py 2017-04-13 21:17:34.539598154 -0400 @@ -19,9 +19,10 @@ Boston, MA 02110-1335 USA @@ -9,25 +7,23 @@ diff -ruN websocket/_logging.py websocket-patch/_logging.py -import logging - -_logger = logging.getLogger('websocket') -+# import logging ++#import logging +from kivy.logger import Logger -+# _logger = logging.getLogger('websocket') ++#_logger = logging.getLogger('websocket') +_logger = Logger _traceEnabled = False __all__ = ["enableTrace", "dump", "error", "debug", "trace", -@@ -67,8 +68,10 @@ +@@ -67,8 +68,9 @@ def isEnabledForError(): - return _logger.isEnabledFor(logging.ERROR) +- ++# return _logger.isEnabledFor(logging.ERROR) + return True -+ # return _logger.isEnabledFor(logging.ERROR) - def isEnabledForDebug(): - return _logger.isEnabledFor(logging.DEBUG) ++# return _logger.isEnabledFor(logging.DEBUG) + return True -+ # return _logger.isEnabledFor(logging.DEBUG) -Binary files websocket/tests/__init__.pyc and websocket-patch/tests/__init__.pyc differ -Binary files websocket/tests/test_websocket.pyc and websocket-patch/tests/test_websocket.pyc differ From 4dd8927e8442b9989ddc36959af2ade04857c4fe Mon Sep 17 00:00:00 2001 From: debauchery1st Date: Sun, 16 Apr 2017 17:25:27 -0400 Subject: [PATCH 06/12] ssl-match-hostname required --- pythonforandroid/recipes/websocket-client/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 984eeff047..7814986848 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -9,7 +9,7 @@ class WebSocketClient(Recipe): patches = ['websocket.patch'] # Paths relative to the recipe dir - depends = ['kivy', 'python2', 'android', 'pyjnius', - 'cryptography', 'pyasn1', 'pyopenssl'] + depends = ['kivy', 'python2', 'android', 'pyjnius', 'backports.ssl-match-hostname', + 'cryptography', 'pyasn1', 'ndg_httpsclient', 'pyopenssl'] recipe = WebSocketClient() From 0ef145f1e5b563fb17a56ec0bd90f8914c151361 Mon Sep 17 00:00:00 2001 From: debauchery1st Date: Sun, 16 Apr 2017 17:31:28 -0400 Subject: [PATCH 07/12] ssl-match-hostname required --- pythonforandroid/recipes/websocket-client/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 7814986848..d21e7465b3 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -9,7 +9,8 @@ class WebSocketClient(Recipe): patches = ['websocket.patch'] # Paths relative to the recipe dir - depends = ['kivy', 'python2', 'android', 'pyjnius', 'backports.ssl-match-hostname', - 'cryptography', 'pyasn1', 'ndg_httpsclient', 'pyopenssl'] + depends = ['kivy', 'python2', 'android', 'pyjnius', + 'backports.ssl-match-hostname', 'cryptography', + 'pyasn1', 'ndg_httpsclient', 'pyopenssl'] recipe = WebSocketClient() From 5a9414881e88f0ba2bc03fdceb1a2f9eb091b1e3 Mon Sep 17 00:00:00 2001 From: Trevor Martin Date: Mon, 17 Apr 2017 12:54:58 -0400 Subject: [PATCH 08/12] git --diff format patch --- .../recipes/websocket-client/__init__.py | 5 ++--- .../recipes/websocket-client/websocket.patch | 17 ++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 7814986848..3390d8876e 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -2,14 +2,13 @@ class WebSocketClient(Recipe): - url = 'https://pypi.python.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz' version = '0.40.0' md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986' patches = ['websocket.patch'] # Paths relative to the recipe dir - depends = ['kivy', 'python2', 'android', 'pyjnius', 'backports.ssl-match-hostname', - 'cryptography', 'pyasn1', 'ndg_httpsclient', 'pyopenssl'] + depends = ['kivy', 'python2', 'android', 'pyjnius', + 'cryptography', 'pyasn1', 'pyopenssl'] recipe = WebSocketClient() diff --git a/pythonforandroid/recipes/websocket-client/websocket.patch b/pythonforandroid/recipes/websocket-client/websocket.patch index bf34fd4209..694bcb653b 100644 --- a/pythonforandroid/recipes/websocket-client/websocket.patch +++ b/pythonforandroid/recipes/websocket-client/websocket.patch @@ -1,29 +1,28 @@ ---- a/websocket/_logging.py 2016-10-02 21:35:05.000000000 -0400 -+++ b/websocket/_logging.py 2017-04-13 21:17:34.539598154 -0400 -@@ -19,9 +19,10 @@ +diff --git a/websocket/_logging.py b/websocket/_logging.py +index 8a5f4a5..cebc23b 100644 +--- a/websocket/_logging.py ++++ b/websocket/_logging.py +@@ -19,9 +19,8 @@ Copyright (C) 2010 Hiroki Ohtani(liris) Boston, MA 02110-1335 USA """ -import logging - -_logger = logging.getLogger('websocket') -+#import logging +from kivy.logger import Logger -+#_logger = logging.getLogger('websocket') +_logger = Logger _traceEnabled = False __all__ = ["enableTrace", "dump", "error", "debug", "trace", -@@ -67,8 +68,9 @@ +@@ -67,8 +66,9 @@ def trace(msg): def isEnabledForError(): - return _logger.isEnabledFor(logging.ERROR) -- -+# return _logger.isEnabledFor(logging.ERROR) + return True + def isEnabledForDebug(): - return _logger.isEnabledFor(logging.DEBUG) -+# return _logger.isEnabledFor(logging.DEBUG) + return True ++ From 26c6f606fc9788ef4487a0265850863ead893c04 Mon Sep 17 00:00:00 2001 From: Trevor Martin Date: Mon, 17 Apr 2017 14:47:00 -0400 Subject: [PATCH 09/12] work-around for patch --- pythonforandroid/recipes/websocket-client/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 3390d8876e..91b89f438f 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -2,11 +2,12 @@ class WebSocketClient(Recipe): - url = 'https://pypi.python.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz' + url = 'https://github.com/debauchery1st/websocket-client/blob/master/websocket_client-0.40.0.tar.gz?raw=true' + # url = 'https://pypi.python.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz' version = '0.40.0' - md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986' + # md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986' - patches = ['websocket.patch'] # Paths relative to the recipe dir + # patches = ['websocket.patch'] # Paths relative to the recipe dir depends = ['kivy', 'python2', 'android', 'pyjnius', 'cryptography', 'pyasn1', 'pyopenssl'] From cb59b5564a50cd5b50f60ccbc892d560ea21e6ea Mon Sep 17 00:00:00 2001 From: Trevor Martin Date: Mon, 17 Apr 2017 14:50:44 -0400 Subject: [PATCH 10/12] fixed url --- pythonforandroid/recipes/websocket-client/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 91b89f438f..e69dad5e58 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -2,7 +2,7 @@ class WebSocketClient(Recipe): - url = 'https://github.com/debauchery1st/websocket-client/blob/master/websocket_client-0.40.0.tar.gz?raw=true' + url = 'https://github.com/debauchery1st/websocket-client/raw/master/websocket_client-0.40.0.tar.gz' # url = 'https://pypi.python.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz' version = '0.40.0' # md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986' From e0b69238b8e5933583a9c010f54b0229681d9f7f Mon Sep 17 00:00:00 2001 From: Trevor Martin Date: Mon, 17 Apr 2017 15:51:04 -0400 Subject: [PATCH 11/12] note about import error --- pythonforandroid/recipes/websocket-client/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index e69dad5e58..257ec00656 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -1,5 +1,11 @@ from pythonforandroid.toolchain import Recipe +# if android app crashes on start with "ImportError: No module named websocket" +# +# copy the 'websocket' directory into your app directory to force inclusion. +# +# see my example at https://github.com/debauchery1st/example_kivy_websocket-recipe + class WebSocketClient(Recipe): url = 'https://github.com/debauchery1st/websocket-client/raw/master/websocket_client-0.40.0.tar.gz' From ffdf43b28fa69aecf1f3c2b7358b8932acaa37ea Mon Sep 17 00:00:00 2001 From: Trevor Martin Date: Mon, 17 Apr 2017 15:52:37 -0400 Subject: [PATCH 12/12] clean up --- pythonforandroid/recipes/websocket-client/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/websocket-client/__init__.py b/pythonforandroid/recipes/websocket-client/__init__.py index 257ec00656..aeb6b3b8a1 100644 --- a/pythonforandroid/recipes/websocket-client/__init__.py +++ b/pythonforandroid/recipes/websocket-client/__init__.py @@ -8,8 +8,9 @@ class WebSocketClient(Recipe): + url = 'https://github.com/debauchery1st/websocket-client/raw/master/websocket_client-0.40.0.tar.gz' - # url = 'https://pypi.python.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz' + version = '0.40.0' # md5sum = 'f1cf4cc7869ef97a98e5f4be25c30986'