mirror of https://github.com/Nonannet/copapy.git
code style fixed and type hints in get_binaries.py fixed
This commit is contained in:
parent
ac98c42761
commit
f97d21e42c
|
|
@ -1,4 +1,4 @@
|
|||
from copapy import variable, NumLike
|
||||
from copapy import NumLike
|
||||
from copapy.backend import Write, compile_to_dag, add_read_command
|
||||
import copapy as cp
|
||||
import subprocess
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from copapy import variable, NumLike
|
||||
from copapy import NumLike
|
||||
from copapy.backend import Write, compile_to_dag, add_read_command
|
||||
import subprocess
|
||||
from copapy import _binwrite
|
||||
|
|
@ -26,7 +26,7 @@ def check_for_qemu() -> bool:
|
|||
command = qemu_command + ['--version']
|
||||
try:
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8', check=False)
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
return result.returncode == 0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from typing import Any
|
||||
import os
|
||||
import json
|
||||
from urllib.request import urlopen, Request
|
||||
|
|
@ -5,13 +6,13 @@ from urllib.request import urlopen, Request
|
|||
OWNER = "Nonannet"
|
||||
REPO = "copapy"
|
||||
|
||||
def fetch_json(url: str):
|
||||
def fetch_json(url: str) -> Any:
|
||||
req = Request(url, headers={"User-Agent": "Python"})
|
||||
with urlopen(req, timeout=10) as resp:
|
||||
assert resp.status == 200
|
||||
return json.load(resp)
|
||||
|
||||
def download_file(url: str, dest_path: str):
|
||||
def download_file(url: str, dest_path: str) -> None:
|
||||
req = Request(url, headers={"User-Agent": "Python"})
|
||||
with urlopen(req, timeout=30) as resp, open(dest_path, "wb") as f:
|
||||
f.write(resp.read())
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
from copapy import variable
|
||||
from copapy.backend import Write, compile_to_dag, stencil_db_from_package
|
||||
import copapy as cp
|
||||
from copapy._binwrite import Command
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue