git commit, converted over to base.html pulling Status*, rather than every render_template calling it. Tightened up naming for job manager, fixed a few bugs in there with items like div by zero, created the active jobs link/badge in navbar, have it invoked each time by base.html template and it gets active jobs from DB, pa_job_manager now initiliases from an empty DB and can work out where it is at, no loop/thread/or actual job code yet. jobs.py has basics of a NewJob(), so next step is to force that job to be executed in pa_job_manager, but its tea time
This commit is contained in:
7
main.py
7
main.py
@@ -31,7 +31,7 @@ from settings import Settings
|
||||
from files import File
|
||||
from person import Person
|
||||
from refimg import Refimg
|
||||
from job import Job
|
||||
from job import Job, GetNumActiveJobs
|
||||
from ai import *
|
||||
|
||||
####################################### CLASSES / DB model #######################################
|
||||
@@ -39,11 +39,14 @@ from ai import *
|
||||
####################################### GLOBALS #######################################
|
||||
# allow jinja2 to call these python functions directly
|
||||
app.jinja_env.globals['ClearStatus'] = st.ClearStatus
|
||||
app.jinja_env.globals['GetAlert'] = st.GetAlert
|
||||
app.jinja_env.globals['GetMessage'] = st.GetMessage
|
||||
app.jinja_env.globals['GetNumActiveJobs'] = GetNumActiveJobs
|
||||
|
||||
# default page, just the navbar
|
||||
@app.route("/", methods=["GET"])
|
||||
def main_page():
|
||||
return render_template("base.html", alert=st.GetAlert(), message=st.GetMessage())
|
||||
return render_template("base.html")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if hostname == PROD_HOST:
|
||||
|
||||
Reference in New Issue
Block a user