Python-Unifi-Client 1.1.3__py3-none-any.whl → 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_unifi_client/client.py +9 -2
- {python_unifi_client-1.1.3.dist-info → python_unifi_client-1.2.1.dist-info}/METADATA +1 -1
- python_unifi_client-1.2.1.dist-info/RECORD +6 -0
- python_unifi_client-1.1.3.dist-info/RECORD +0 -6
- {python_unifi_client-1.1.3.dist-info → python_unifi_client-1.2.1.dist-info}/WHEEL +0 -0
- {python_unifi_client-1.1.3.dist-info → python_unifi_client-1.2.1.dist-info}/top_level.txt +0 -0
python_unifi_client/client.py
CHANGED
|
@@ -10,6 +10,8 @@ import http.client as http_client
|
|
|
10
10
|
import logging
|
|
11
11
|
import base64
|
|
12
12
|
|
|
13
|
+
|
|
14
|
+
|
|
13
15
|
# Custom exceptions mirroring PHP equivalents
|
|
14
16
|
class CurlExtensionNotLoadedException(Exception):
|
|
15
17
|
def __init__(self):
|
|
@@ -77,7 +79,7 @@ class Client:
|
|
|
77
79
|
CURL_METHODS_ALLOWED = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']
|
|
78
80
|
DEFAULT_CURL_METHOD = 'GET'
|
|
79
81
|
|
|
80
|
-
def __init__(self, user, password, baseurl='https://32.218.193.188', site='default', version='8.0.28', ssl_verify=False, unificookie_name='unificookie'):
|
|
82
|
+
def __init__(self, user, password, baseurl='https://32.218.193.188', site='default', version='8.0.28', ssl_verify=False, unificookie_name='unificookie', debug=False):
|
|
81
83
|
# Initial setup mirrors PHP constructor
|
|
82
84
|
self._check_curl()
|
|
83
85
|
self._check_base_url(baseurl)
|
|
@@ -105,7 +107,12 @@ class Client:
|
|
|
105
107
|
self._last_results_raw = None
|
|
106
108
|
self._cookies_created_at = 0
|
|
107
109
|
self._exec_retries = 0
|
|
108
|
-
self.debug =
|
|
110
|
+
self.debug = debug
|
|
111
|
+
|
|
112
|
+
if self.debug:
|
|
113
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
114
|
+
logging.getLogger('requests.packages.urllib3').setLevel(logging.DEBUG)
|
|
115
|
+
http_client.HTTPConnection.debuglevel = 1
|
|
109
116
|
|
|
110
117
|
self._curl_headers = {
|
|
111
118
|
'Accept': 'application/json',
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
python_unifi_client/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
2
|
+
python_unifi_client/client.py,sha256=LUdODRnoZCCbr5gHnC1GV7TRcUb11MWkkUdXjCejjX8,105676
|
|
3
|
+
python_unifi_client-1.2.1.dist-info/METADATA,sha256=5DgF3hLjzl30pBxVr-0tjtYU2wxl7hl08bS38CszS4Q,2483
|
|
4
|
+
python_unifi_client-1.2.1.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
5
|
+
python_unifi_client-1.2.1.dist-info/top_level.txt,sha256=675fDdb69Hi9X8pSEGl6f03ZpUXNiumV-s1B1gXEeYs,20
|
|
6
|
+
python_unifi_client-1.2.1.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
python_unifi_client/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
2
|
-
python_unifi_client/client.py,sha256=PM8O-Xd7Ex8ENWFYQGQEEw6DDHqLYFdHlE_dwGVvgGg,105440
|
|
3
|
-
python_unifi_client-1.1.3.dist-info/METADATA,sha256=kOEMyQpOFbrq0yqM-iNOWuPywsYnsGqM54z8bpTLnVQ,2483
|
|
4
|
-
python_unifi_client-1.1.3.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
5
|
-
python_unifi_client-1.1.3.dist-info/top_level.txt,sha256=675fDdb69Hi9X8pSEGl6f03ZpUXNiumV-s1B1gXEeYs,20
|
|
6
|
-
python_unifi_client-1.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|