-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
21 lines (15 loc) · 702 Bytes
/
app.py
File metadata and controls
21 lines (15 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import logging
from lib.GenerationHandler import GenerationHandler
CWD = os.path.dirname(__file__)
PAGE_TEMPLATE = os.path.join(CWD, "templates", "page_template.html")
LINK_TEMPLATE = os.path.join(CWD, "templates", "link_template.html")
SERVICES_FILE = "/etc/nginx/sites-available/services.conf"
OUTPUT_FILE = "/var/www/html/index.html"
LOG_FILE = "/var/log/nipg.log"
LOG_FORMAT = "%(asctime)s - %(message)s"
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT, datefmt=DATE_FORMAT, filename=LOG_FILE)
handler = GenerationHandler(SERVICES_FILE, OUTPUT_FILE, PAGE_TEMPLATE, LINK_TEMPLATE)
handler.generate()