commit ec5ae3143156917406d29fb174ce9534ac090910
parent 1a6a35f206003c484ca1b9fa481c9639a6a1318d
Author: René Wagner <rwa@clttr.info>
Date: Sun, 27 Aug 2023 12:55:10 +0200
remove usage of cgi module
Diffstat:
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/gusmobile/client.py b/gusmobile/client.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import cgi
+from email.message import EmailMessage
import codecs
import collections
import fnmatch
@@ -164,7 +164,9 @@ def fetch(raw_url):
mime = meta
if mime == "":
mime = "text/gemini; charset=utf-8"
- mime, mime_options = cgi.parse_header(mime)
+ msg = EmailMessage()
+ msg['content-type'] = mime
+ mime, mime_options = msg.get_content_type(), msg['content_type'].params
default_charset = "utf-8"
charset = None
if "charset" in mime_options:
diff --git a/setup.py b/setup.py
@@ -4,19 +4,19 @@ from setuptools import setup
setup(
name="gusmobile",
- version="0.1.0",
- author="Jason McBrayer",
- author_email="jmcbray@carcosa.net",
+ version="0.4.0",
+ author="Jason McBrayer & René Wagner",
+ author_email="rwa@clttr.info",
description=(
"A simple library for requesting resources using the " "gemini protocol"
),
license="AGPL3",
keywords="gemini client internet",
- url="https://git.carcosa.net/jmcbray/gusmobile/",
+ url="https://git.sr.ht/~rwa/gusmobile/",
packages=["gusmobile", "tests"],
long_description="gemini client lib",
classifiers=[
- "Development Status :: 3 - Alpha",
+ "Development Status :: 2 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3 "
"or later (AGPLv3+)",