Browse Source

chore: blackify the scripts

pull/55/head
mingrammer 4 years ago
parent
commit
0d07fbba4c
2 changed files with 9 additions and 9 deletions
  1. +1
    -1
      scripts/generate.py
  2. +8
    -8
      scripts/resource.py

+ 1
- 1
scripts/generate.py View File

@@ -54,7 +54,7 @@ def gen_apidoc(pvd: str, typ_paths: dict) -> str:
typ_classes[typ] = []
for name in map(_gen_class_name, paths):
alias = cfg.ALIASES[pvd].get(typ, {}).get(name)
typ_classes[typ].append({'name': name, 'alias': alias})
typ_classes[typ].append({"name": name, "alias": alias})
return tmpl.render(pvd=pvd, typ_classes=typ_classes)




+ 8
- 8
scripts/resource.py View File

@@ -27,7 +27,7 @@ def cleaner_aws(f):
f = f.replace("-light-bg", "")
for p in cfg.FILE_PREFIXES["aws"]:
if f.startswith(p):
f = f[len(p):]
f = f[len(p) :]
break
return f.lower()

@@ -38,7 +38,7 @@ def cleaner_azure(f):
f = "-".join(f.split())
for p in cfg.FILE_PREFIXES["azure"]:
if f.startswith(p):
f = f[len(p):]
f = f[len(p) :]
break
return f.lower()

@@ -48,7 +48,7 @@ def cleaner_gcp(f):
f = "-".join(f.split())
for p in cfg.FILE_PREFIXES["gcp"]:
if f.startswith(p):
f = f[len(p):]
f = f[len(p) :]
break
return f.lower()

@@ -57,7 +57,7 @@ def cleaner_k8s(f):
f = f.replace("-256", "")
for p in cfg.FILE_PREFIXES["k8s"]:
if f.startswith(p):
f = f[len(p):]
f = f[len(p) :]
break
return f.lower()

@@ -65,7 +65,7 @@ def cleaner_k8s(f):
def cleaner_alibabacloud(f):
for p in cfg.FILE_PREFIXES["alibabacloud"]:
if f.startswith(p):
f = f[len(p):]
f = f[len(p) :]
break
return f.lower()

@@ -75,7 +75,7 @@ def cleaner_oci(f):
f = f.replace("-grey", "")
for p in cfg.FILE_PREFIXES["oci"]:
if f.startswith(p):
f = f[len(p):]
f = f[len(p) :]
break
return f.lower()

@@ -124,7 +124,7 @@ def svg2png(pvd: str) -> None:
def _convert(base: str, path: str):
path = os.path.join(base, path)
subprocess.call([cfg.CMD_SVG2PNG, *cfg.CMD_SVG2PNG_OPTS, path])
subprocess.call(['rm', path])
subprocess.call(["rm", path])

for root, _, files in os.walk(resource_dir(pvd)):
svgs = filter(lambda f: f.endswith(".svg"), files)
@@ -138,7 +138,7 @@ def svg2png2(pvd: str) -> None:
path_src = os.path.join(base, path)
path_dest = path_src.replace(".svg", ".png")
subprocess.call([cfg.CMD_SVG2PNG_IM, *cfg.CMD_SVG2PNG_IM_OPTS, path_src, path_dest])
subprocess.call(['rm', path_src])
subprocess.call(["rm", path_src])

for root, _, files in os.walk(resource_dir(pvd)):
svgs = filter(lambda f: f.endswith(".svg"), files)


Loading…
Cancel
Save