core: opti readme search
This commit is contained in:
parent
a4324c61d0
commit
637e2382b2
@ -50,6 +50,12 @@ def get_updated_folders(path: str):
|
|||||||
|
|
||||||
return updated_folders
|
return updated_folders
|
||||||
|
|
||||||
|
def get_readme(folder):
|
||||||
|
absolut_path: str = os.path.join(folder, "readme.md")
|
||||||
|
if (os.path.exists(absolut_path)):
|
||||||
|
return absolut_path
|
||||||
|
return None
|
||||||
|
|
||||||
def gen_pages(folders: list[str]):
|
def gen_pages(folders: list[str]):
|
||||||
with Bar("generating...", max=len(folders)) as bar:
|
with Bar("generating...", max=len(folders)) as bar:
|
||||||
for folder in folders:
|
for folder in folders:
|
||||||
@ -58,8 +64,7 @@ def gen_pages(folders: list[str]):
|
|||||||
raws: list[str] = [file for file in files if file.endswith(".NEF")]
|
raws: list[str] = [file for file in files if file.endswith(".NEF")]
|
||||||
raw: str = raws[0] if len(raws) > 0 else None
|
raw: str = raws[0] if len(raws) > 0 else None
|
||||||
exif: str = get_exif(folder, raw)
|
exif: str = get_exif(folder, raw)
|
||||||
readmes: list[str] = [file for file in files if file == "readme.md"]
|
readme: str = get_readme(folder)
|
||||||
readme: str = readmes[0] if len(readmes) > 0 else None
|
|
||||||
bar.next()
|
bar.next()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user