(self, url: str)
| 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(): |
no test coverage detected