pythonanywhere-core 0.3.0__tar.gz → 0.3.2__tar.gz
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-0.3.0 → pythonanywhere_core-0.3.2}/PKG-INFO +2 -1
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pyproject.toml +1 -1
- pythonanywhere_core-0.3.2/pythonanywhere_core/__init__.py +1 -0
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/base.py +0 -1
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/files.py +6 -2
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/website.py +11 -2
- pythonanywhere_core-0.3.0/pythonanywhere_core/__init__.py +0 -1
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/LICENSE +0 -0
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/README.rst +0 -0
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/exceptions.py +0 -0
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/resources.py +0 -0
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/schedule.py +0 -0
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/students.py +0 -0
- {pythonanywhere_core-0.3.0 → pythonanywhere_core-0.3.2}/pythonanywhere_core/webapp.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonanywhere-core
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: API wrapper for programmatic management of PythonAnywhere services.
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
20
21
|
Classifier: Topic :: Software Development :: Libraries
|
|
21
22
|
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
|
22
23
|
Requires-Dist: requests (>=2.30.0,<3.0.0)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.2"
|
|
@@ -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
|
|
@@ -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
|
|
|
@@ -90,6 +90,10 @@ class Website:
|
|
|
90
90
|
"post",
|
|
91
91
|
json={"cert_type": "letsencrypt-auto-renew"}
|
|
92
92
|
)
|
|
93
|
+
if not response.ok:
|
|
94
|
+
raise PythonAnywhereApiException(
|
|
95
|
+
f"POST to set Let's Encrypt SSL certificate via API failed, got {response}:{response.text}"
|
|
96
|
+
)
|
|
93
97
|
return response.json()
|
|
94
98
|
|
|
95
99
|
def get_ssl_info(self, domain_name) -> dict:
|
|
@@ -106,10 +110,15 @@ class Website:
|
|
|
106
110
|
def delete(self, domain_name: str) -> dict:
|
|
107
111
|
"""Deletes website with ``domain_name``.
|
|
108
112
|
:param domain_name: domain name for website to delete
|
|
109
|
-
:return: empty dictionary
|
|
113
|
+
:return: empty dictionary on HTTP 204
|
|
114
|
+
:raises PythonAnywhereApiException: if the response is not HTTP 204"""
|
|
110
115
|
|
|
111
|
-
call_api(
|
|
116
|
+
response = call_api(
|
|
112
117
|
f"{self.websites_base_url}{domain_name}/",
|
|
113
118
|
"delete",
|
|
114
119
|
)
|
|
120
|
+
if response.status_code != 204:
|
|
121
|
+
raise PythonAnywhereApiException(
|
|
122
|
+
f"DELETE website via API failed, got {response}:{response.text}"
|
|
123
|
+
)
|
|
115
124
|
return {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|