mirror of
https://github.com/CrispyPin/crispypin.cc.git
synced 2025-02-22 20:53:59 +01:00
clean up python with black
This commit is contained in:
parent
cb5d7c726b
commit
644ce83d14
1 changed files with 5 additions and 4 deletions
|
@ -8,6 +8,7 @@ TARGET_DIR = "./docs/"
|
||||||
INCLUDE_MARKER = "<include "
|
INCLUDE_MARKER = "<include "
|
||||||
INCLUDE_MARKER_END = "/>"
|
INCLUDE_MARKER_END = "/>"
|
||||||
|
|
||||||
|
|
||||||
def process_dir(path: str = "") -> None:
|
def process_dir(path: str = "") -> None:
|
||||||
items = os.listdir(PAGE_DIR + path)
|
items = os.listdir(PAGE_DIR + path)
|
||||||
for name in items:
|
for name in items:
|
||||||
|
@ -17,7 +18,7 @@ def process_dir(path: str = "") -> None:
|
||||||
process_file(path + name)
|
process_file(path + name)
|
||||||
|
|
||||||
|
|
||||||
def process_file(filepath: str) -> str:
|
def process_file(filepath: str) -> None:
|
||||||
print("processing " + filepath)
|
print("processing " + filepath)
|
||||||
contents = read_file(PAGE_DIR + filepath)
|
contents = read_file(PAGE_DIR + filepath)
|
||||||
while INCLUDE_MARKER in contents:
|
while INCLUDE_MARKER in contents:
|
||||||
|
@ -61,7 +62,7 @@ def get_included_name(contents):
|
||||||
|
|
||||||
def get_marker_indices(contents: str) -> tuple:
|
def get_marker_indices(contents: str) -> tuple:
|
||||||
index_start = contents.find(INCLUDE_MARKER)
|
index_start = contents.find(INCLUDE_MARKER)
|
||||||
index_end = contents.find(INCLUDE_MARKER_END, index_start)
|
index_end = contents.find(INCLUDE_MARKER_END, index_start)
|
||||||
return (index_start, index_end)
|
return (index_start, index_end)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue