mirror of
https://github.com/FAUSheppy/python-flask-picture-factory
synced 2025-12-08 15:58:33 +01:00
implement simple depth-1 listing
This commit is contained in:
12
server.py
12
server.py
@@ -88,6 +88,18 @@ def sendPicture(path):
|
|||||||
response.headers['X-ATHQ-INTERNAL-FID'] = path
|
response.headers['X-ATHQ-INTERNAL-FID'] = path
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def list():
|
||||||
|
retString = ".\n"
|
||||||
|
print(PICTURE_DIR)
|
||||||
|
for root, dirs, files in os.walk(PICTURE_DIR):
|
||||||
|
path = root.split(os.sep)
|
||||||
|
for f in files:
|
||||||
|
retString += os.path.join(os.path.basename(root), f) + "<br>\n"
|
||||||
|
|
||||||
|
return (retString, 200)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Picture Factory',
|
parser = argparse.ArgumentParser(description='Picture Factory',
|
||||||
|
|||||||
Reference in New Issue
Block a user