From ec871e108179363f8e4687c5fe764545156ee639 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:02:10 +0200 Subject: [PATCH] remote --- remote.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 remote.py diff --git a/remote.py b/remote.py new file mode 100644 index 0000000..6c70a00 --- /dev/null +++ b/remote.py @@ -0,0 +1,25 @@ +import os +import requests + +import arguments +import hypertext + + +CHARSET = 'u8' +DISTRIBUTION = 'distrib' + + +class Remote: + def __init__(self, args): + self.location = args[arguments.REMOTE] + + def fetch_latest_distribution(self, architecture): + url = os.path.join(self.location, DISTRIBUTION, architecture) + html = requests.get(url).content.decode(CHARSET) + links = hypertext.get_links(html) + print(links) + + def __str__(self): + return f'''\ +Location: {self.location} +'''