mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Autogen. missing category pages
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
import json
|
||||
import os
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
def ReadFile(p):
|
||||
try:
|
||||
@ -35,6 +36,13 @@ def FileToStr(File, Truncate=''):
|
||||
def IgnoreFiles(Dir, Files):
|
||||
return [f for f in Files if os.path.isfile(os.path.join(Dir, f))]
|
||||
|
||||
def LoadFromDir(Dir, Rglob):
|
||||
Contents = {}
|
||||
for File in Path(Dir).rglob(Rglob):
|
||||
File = str(File)[len(Dir)+1:]
|
||||
Contents.update({File: ReadFile('{}/{}'.format(Dir, File))})
|
||||
return Contents
|
||||
|
||||
def StripExt(Path):
|
||||
return ".".join(Path.split('.')[:-1])
|
||||
|
||||
|
Reference in New Issue
Block a user