remote
This commit is contained in:
parent
523c5eca81
commit
ec871e1081
1 changed files with 25 additions and 0 deletions
25
remote.py
Normal file
25
remote.py
Normal file
|
@ -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}
|
||||
'''
|
Loading…
Reference in a new issue