bytebeat_compiler.py: function fetch
: simplify code
This commit is contained in:
parent
a473c1f39a
commit
073b9a04f4
@ -39,10 +39,10 @@ DEFAULT_PARAMETERS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def fetch(name: str):
|
def fetch(name: str):
|
||||||
res = DEFAULT_PARAMETERS[name]
|
|
||||||
if from_env := environ.get(name):
|
if from_env := environ.get(name):
|
||||||
res = from_env
|
return from_env
|
||||||
return res
|
else:
|
||||||
|
return DEFAULT_PARAMETERS[name]
|
||||||
|
|
||||||
def read_file(path: str) -> str:
|
def read_file(path: str) -> str:
|
||||||
return open(path, "r", encoding="utf-8-sig").read()
|
return open(path, "r", encoding="utf-8-sig").read()
|
||||||
|
Loading…
Reference in New Issue
Block a user