aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'server.py')
-rw-r--r--server.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/server.py b/server.py
index ea04690..1908ad3 100644
--- a/server.py
+++ b/server.py
@@ -6,6 +6,7 @@ app = Flask(__name__)
from views import *
+
def setup():
"""
setup - sets up the app according to the settings specified (or not
@@ -20,21 +21,18 @@ def setup():
if siteconfig.MAIN_SITE_DIRS:
app.config.update({'MAIN_SITE_DIRS': siteconfig.MAIN_SITE_DIRS})
else:
- s = './templates/site/'
+ s = "./templates/site/"
top_dirs = [
x for x in os.listdir(s) \
- if os.path.isdir(s + x) and not x.startswith('.')
+ if os.path.isdir(s + x) and not x.startswith(".")
]
- app.config.update(
- {
- 'MAIN_SITE_DIRS': sorted(top_dirs)
- }
- )
+ app.config.update({'MAIN_SITE_DIRS': sorted(top_dirs)})
app.config.update({'DOMAIN': siteconfig.DOMAIN})
app.config.update({'HOME_TITLE': siteconfig.HOME_TITLE})
+
# Setup needs to come first to be compatible with wsgi
setup()
-if __name__ == '__main__':
+if __name__ == "__main__":
app.run()