mirror of
https://github.com/FAUSheppy/flask-json-dream-website
synced 2025-12-06 08:11:35 +01:00
add warnings for empty dirs
This commit is contained in:
@@ -115,6 +115,9 @@ def readJsonDir(basedir):
|
|||||||
with open(os.path.join(basedir, filename)) as f:
|
with open(os.path.join(basedir, filename)) as f:
|
||||||
jsonDictList += [json.load(f)]
|
jsonDictList += [json.load(f)]
|
||||||
|
|
||||||
|
if not jsonDictList:
|
||||||
|
print("Warning: {} is an empty directory".format(basedir), file=sys.stderr)
|
||||||
|
|
||||||
return jsonDictList
|
return jsonDictList
|
||||||
|
|
||||||
def parseNewsDirWithTimeout():
|
def parseNewsDirWithTimeout():
|
||||||
@@ -322,6 +325,8 @@ def init():
|
|||||||
|
|
||||||
choiceLoader = jinja2.ChoiceLoader([ app.jinja_loader, fsLoader])
|
choiceLoader = jinja2.ChoiceLoader([ app.jinja_loader, fsLoader])
|
||||||
app.jinja_loader = choiceLoader
|
app.jinja_loader = choiceLoader
|
||||||
|
else:
|
||||||
|
print("Warning: Subpage Config File not found", file=sys.stderr)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user