pythonanywhere-core 0.3.1__py3-none-any.whl → 0.3.2__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.
- pythonanywhere_core/__init__.py +1 -1
- pythonanywhere_core/base.py +0 -1
- pythonanywhere_core/files.py +6 -2
- pythonanywhere_core/website.py +7 -2
- {pythonanywhere_core-0.3.1.dist-info → pythonanywhere_core-0.3.2.dist-info}/METADATA +1 -1
- pythonanywhere_core-0.3.2.dist-info/RECORD +13 -0
- pythonanywhere_core-0.3.1.dist-info/RECORD +0 -13
- {pythonanywhere_core-0.3.1.dist-info → pythonanywhere_core-0.3.2.dist-info}/WHEEL +0 -0
- {pythonanywhere_core-0.3.1.dist-info → pythonanywhere_core-0.3.2.dist-info}/licenses/LICENSE +0 -0
pythonanywhere_core/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.3.
|
|
1
|
+
__version__ = "0.3.2"
|
pythonanywhere_core/base.py
CHANGED
|
@@ -96,6 +96,5 @@ def call_api(url: str, method: str, **kwargs) -> requests.Response:
|
|
|
96
96
|
**kwargs,
|
|
97
97
|
)
|
|
98
98
|
if response.status_code == 401:
|
|
99
|
-
print(response, response.text)
|
|
100
99
|
raise AuthenticationError(f"Authentication error {response.status_code} calling API: {response.text}")
|
|
101
100
|
return response
|
pythonanywhere_core/files.py
CHANGED
|
@@ -137,7 +137,7 @@ class Files:
|
|
|
137
137
|
"""Checks sharing status for a `path`.
|
|
138
138
|
|
|
139
139
|
Returns url with sharing link if file is shared or an empty
|
|
140
|
-
string
|
|
140
|
+
string on HTTP 404 (not shared). Raises on other API errors."""
|
|
141
141
|
|
|
142
142
|
url = f"{self.sharing_endpoint}?path={path}"
|
|
143
143
|
|
|
@@ -145,9 +145,13 @@ class Files:
|
|
|
145
145
|
if result.ok:
|
|
146
146
|
sharing_url_suffix = result.json()["url"]
|
|
147
147
|
return self._make_sharing_url(sharing_url_suffix)
|
|
148
|
-
|
|
148
|
+
if result.status_code == 404:
|
|
149
149
|
return ""
|
|
150
150
|
|
|
151
|
+
raise PythonAnywhereApiException(
|
|
152
|
+
f"GET sharing status for {url} failed, got {result}{self._error_msg(result)}"
|
|
153
|
+
)
|
|
154
|
+
|
|
151
155
|
def sharing_delete(self, path: str) -> int:
|
|
152
156
|
"""Stops sharing file at `path`.
|
|
153
157
|
|
pythonanywhere_core/website.py
CHANGED
|
@@ -110,10 +110,15 @@ class Website:
|
|
|
110
110
|
def delete(self, domain_name: str) -> dict:
|
|
111
111
|
"""Deletes website with ``domain_name``.
|
|
112
112
|
:param domain_name: domain name for website to delete
|
|
113
|
-
:return: empty dictionary
|
|
113
|
+
:return: empty dictionary on HTTP 204
|
|
114
|
+
:raises PythonAnywhereApiException: if the response is not HTTP 204"""
|
|
114
115
|
|
|
115
|
-
call_api(
|
|
116
|
+
response = call_api(
|
|
116
117
|
f"{self.websites_base_url}{domain_name}/",
|
|
117
118
|
"delete",
|
|
118
119
|
)
|
|
120
|
+
if response.status_code != 204:
|
|
121
|
+
raise PythonAnywhereApiException(
|
|
122
|
+
f"DELETE website via API failed, got {response}:{response.text}"
|
|
123
|
+
)
|
|
119
124
|
return {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
pythonanywhere_core/__init__.py,sha256=vNiWJ14r_cw5t_7UDqDQIVZvladKFGyHH2avsLpN7Vg,22
|
|
2
|
+
pythonanywhere_core/base.py,sha256=nyyX53D0O5o_1a9rHhJDHUM24wlCr0SS544ZZbXbOYw,3415
|
|
3
|
+
pythonanywhere_core/exceptions.py,sha256=37aZy6txVFuiXfUdRJA5d7NQ1N5vbkdOveqv8rwnDbk,691
|
|
4
|
+
pythonanywhere_core/files.py,sha256=UfC7GroBnsIQd_9YYPFhadTDmGc9DC_nEdvFuDWDifM,7741
|
|
5
|
+
pythonanywhere_core/resources.py,sha256=VBXspr1sGhfAVSFoTQtwpeN5CDG9-wHZwXJ3-5vy7dY,1167
|
|
6
|
+
pythonanywhere_core/schedule.py,sha256=payqSYJf92gQzsZwVBtccXH4m_C--AAbdbf5DOtImhs,3900
|
|
7
|
+
pythonanywhere_core/students.py,sha256=VfdftRrwPFEb-m2LW7pbiS9LiffwFNTfHpVeLXMQLLc,1774
|
|
8
|
+
pythonanywhere_core/webapp.py,sha256=inwCDOHY_7IVQXJTeAxucn5vYPpJNdn-JLM3ji5gHwQ,11308
|
|
9
|
+
pythonanywhere_core/website.py,sha256=O4RcvhBDPCdlaF7h432cr-D1XWb7IbeKPh_TuPNnBh4,4815
|
|
10
|
+
pythonanywhere_core-0.3.2.dist-info/METADATA,sha256=9-_iLzlyOEL3EjItF3ciHp59EJ1IUyWF2odjGFH60QM,1931
|
|
11
|
+
pythonanywhere_core-0.3.2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
12
|
+
pythonanywhere_core-0.3.2.dist-info/licenses/LICENSE,sha256=zOJT_E5Fv8crFEKS5ulv0btbjnUiIkdsEBPEBmLHRlQ,1080
|
|
13
|
+
pythonanywhere_core-0.3.2.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
pythonanywhere_core/__init__.py,sha256=r4xAFihOf72W9TD-lpMi6ntWSTKTP2SlzKP1ytkjRbI,22
|
|
2
|
-
pythonanywhere_core/base.py,sha256=l4GiEa-oe-EyAc_knX9kqmzQsPEIAH3ec1CivkWeK3Q,3454
|
|
3
|
-
pythonanywhere_core/exceptions.py,sha256=37aZy6txVFuiXfUdRJA5d7NQ1N5vbkdOveqv8rwnDbk,691
|
|
4
|
-
pythonanywhere_core/files.py,sha256=XjOsxei_tDgrubUVMmH4iYgc4sTmoFNk5EtZMJR3-0Q,7531
|
|
5
|
-
pythonanywhere_core/resources.py,sha256=VBXspr1sGhfAVSFoTQtwpeN5CDG9-wHZwXJ3-5vy7dY,1167
|
|
6
|
-
pythonanywhere_core/schedule.py,sha256=payqSYJf92gQzsZwVBtccXH4m_C--AAbdbf5DOtImhs,3900
|
|
7
|
-
pythonanywhere_core/students.py,sha256=VfdftRrwPFEb-m2LW7pbiS9LiffwFNTfHpVeLXMQLLc,1774
|
|
8
|
-
pythonanywhere_core/webapp.py,sha256=inwCDOHY_7IVQXJTeAxucn5vYPpJNdn-JLM3ji5gHwQ,11308
|
|
9
|
-
pythonanywhere_core/website.py,sha256=RnMf97CjfLnDF2aFiH_EJcuChBrGhZ7DMErWkpmXqHM,4535
|
|
10
|
-
pythonanywhere_core-0.3.1.dist-info/METADATA,sha256=wsbVvuF57oHtgGdHNuQM01HgX9GCgfM3B4i0Dvt0c2Y,1931
|
|
11
|
-
pythonanywhere_core-0.3.1.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
12
|
-
pythonanywhere_core-0.3.1.dist-info/licenses/LICENSE,sha256=zOJT_E5Fv8crFEKS5ulv0btbjnUiIkdsEBPEBmLHRlQ,1080
|
|
13
|
-
pythonanywhere_core-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
{pythonanywhere_core-0.3.1.dist-info → pythonanywhere_core-0.3.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|