# Path: webphamerator/app/celery_ext/celery_app.py
# def make_celery(app_name=__name__):
# 
# Path: webphamerator/app/auth.py
# AUTHENTICATION_NOT_NEEDED = ['/signin', '/db', '/static']
# def require_authentication():
# def is_authenticated():
# def is_password_required():
# def set_password(password):
# def delete_password():
# def sign_out():
# def authenticate(password):
# def is_password_valid(password):
# def digest(password, salt):
# def template_context():
# def show_sign_out_button():
# 
# Path: webphamerator/app/sqlalchemy_ext/models.py
# class Database(db.Model):
# class Job(db.Model):
# class JobOrganismToDelete(db.Model):
# class GenbankFile(db.Model):
# class Password(db.Model):
#     def url(self):
#     def mysql_name_for(cls, name):
#     def phamerator_name_for(cls, name):
#     def mysql_name(self):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):


from flask import (
        render_template, abort, request, url_for, redirect,
        send_from_directory, make_response, session, current_app, Blueprint)
from webphamerator.app.celery_ext.celery_app import celery
from webphamerator.app import auth
from webphamerator.app.sqlalchemy_ext import (db, models)
from pdm_utils import AlchemyHandler
import pham.db
import os
import io
    job = db.session.query(models.Job).filter(models.Job.id == job_id).first()

    if job is None:
        abort(404)

    if not job.seen:
        job.seen = True
        db.session.commit()

    runtime = None
    if job.runtime is not None:
        runtime = job.runtime.total_seconds() * 1000

    start_time = job.start_time
    if start_time is None:
        start_time = job.modified

    return render_template('job.html',
                           title='Job - {}'.format(job.database_name),
                           job=job,
                           start_time=start_time,
                           end_time=job.modified,
                           runtime=runtime,
                           phages_to_add=job.genbank_files_to_add.all(),
                           phages_to_remove=job.organism_ids_to_delete.all(),
                           navbar=get_navbar('/jobs'))


@bp.route('/jobs/<int:job_id>', methods=['POST'])
def delete_job(job_id):

# Path: webphamerator/app/celery_ext/celery_app.py
# def make_celery(app_name=__name__):
# 
# Path: webphamerator/app/auth.py
# AUTHENTICATION_NOT_NEEDED = ['/signin', '/db', '/static']
# def require_authentication():
# def is_authenticated():
# def is_password_required():
# def set_password(password):
# def delete_password():
# def sign_out():
# def authenticate(password):
# def is_password_valid(password):
# def digest(password, salt):
# def template_context():
# def show_sign_out_button():
# 
# Path: webphamerator/app/sqlalchemy_ext/models.py
# class Database(db.Model):
# class Job(db.Model):
# class JobOrganismToDelete(db.Model):
# class GenbankFile(db.Model):
# class Password(db.Model):
#     def url(self):
#     def mysql_name_for(cls, name):
#     def phamerator_name_for(cls, name):
#     def mysql_name(self):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):
#     def __repr__(self):


# Path: webphamerator/app/views.py
from flask import (
        render_template, abort, request, url_for, redirect,
        send_from_directory, make_response, session, current_app, Blueprint)
from webphamerator.app.celery_ext.celery_app import celery
from webphamerator.app import auth
from webphamerator.app.sqlalchemy_ext import (db, models)
from pdm_utils import AlchemyHandler
import pham.db
import os
import io

    job = db.session.query(models.Job).filter(models.Job.id == job_id).first()

    if job is None:
        abort(404)

    if not job.seen:
        job.seen = True
        db.session.commit()

    runtime = None
    if job.runtime is not None:
        runtime = job.runtime.total_seconds() * 1000

    start_time = job.start_time
    if start_time is None:
        start_time = job.modified

    return render_template('job.html',
                           title='Job - {}'.format(job.database_name),
                           job=job,
                           start_time=start_time,
                           end_time=job.modified,
                           runtime=runtime,
                           phages_to_add=job.genbank_files_to_add.all(),
                           phages_to_remove=job.organism_ids_to_delete.all(),
                           navbar=get_navbar('/jobs'))


@bp.route('/jobs/<int:job_id>', methods=['POST'])
def delete_job(job_id):

    job = db.session.query(models.Job).filter(models.Job.id == job_id).first()