MCPcopy Create free account
hub / github.com/archlinux/archinstall / _fetch_from_url

Method _fetch_from_url

archinstall/lib/args.py:752–763  ·  view source on GitHub ↗
(self, url: str)

Source from the content-addressed store, hash-verified

750 return json.loads(creds_data)
751
752 def _fetch_from_url(self, url: str) -> str:
753 if urllib.parse.urlparse(url).scheme:
754 try:
755 req = Request(url, headers={'User-Agent': 'ArchInstall'})
756 with urlopen(req) as resp:
757 return resp.read().decode('utf-8')
758 except urllib.error.HTTPError as err:
759 error(f'Could not fetch JSON from {url}: {err}')
760 else:
761 error('Not a valid url')
762
763 sys.exit(1)
764
765 def _write_plugin_to_temp_file(self, plugin_data: str) -> Path:
766 if not plugin_data.strip():

Callers 2

_parse_argsMethod · 0.95
_parse_configMethod · 0.95

Calls 3

errorFunction · 0.90
exitMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected