From a5c887343652fb3f211dc583919628bf810a102d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 21:37:22 +0200 Subject: [PATCH] charset --- hypertext.py | 4 ++-- msys.py | 1 - package.py | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 msys.py diff --git a/hypertext.py b/hypertext.py index 344d3a1..fad9918 100644 --- a/hypertext.py +++ b/hypertext.py @@ -1,7 +1,7 @@ import html.parser import requests -import msys +CHARSET = 'u8' class Parser(html.parser.HTMLParser): @@ -21,7 +21,7 @@ class HyperText: self.load() def load(self): - hypertext = requests.get(self.location).content.decode(msys.CHARSET) + hypertext = requests.get(self.location).content.decode(CHARSET) parser = Parser() parser.feed(hypertext) self.links = parser.links diff --git a/msys.py b/msys.py deleted file mode 100644 index 3314e45..0000000 --- a/msys.py +++ /dev/null @@ -1 +0,0 @@ -CHARSET = 'u8' diff --git a/package.py b/package.py index f8f0b9c..7b16b84 100644 --- a/package.py +++ b/package.py @@ -1,7 +1,6 @@ import os -import msys - +CHARSET = 'u8' KEY = '%' SEPARATOR = f'{os.linesep}{os.linesep}' @@ -9,7 +8,7 @@ SEPARATOR = f'{os.linesep}{os.linesep}' class Package: def __init__(self, package, files): for binary in [package, files]: - text = binary.decode(msys.CHARSET).strip() + text = binary.decode(CHARSET).strip() for item in text.split(SEPARATOR): line, *lines = item.split(os.linesep) key = line.split(KEY)[1].lower()