Source /

from flask import Flask, url_for
from flask import render_template
from flask_flatpages import FlatPages
from Bio import Entrez, Medline
import os
import datetime

from import SoftwareList

app = Flask(__name__)

# set up flatpages
app.config.FLATPAGES_ROOT = 'pages'
pages = FlatPages(app)

app.debug = True

def hello():
    return render_template('index.html')

def software_list():
    software = SoftwareList(os.path.join(os.path.dirname(__file__),'software.yaml'))
    return render_template('software.html',software =

def publication_list():
    pubids = set()
    with open('pubmed_list.txt','r') as pubmed_file:
        for line in pubmed_file:
    handle = Entrez.efetch(db="pubmed",
                           id = pubids,
                           rettype = "medline",
                           retmode = "text",
                           email = '')
    records = []
    for rec in Medline.parse(handle):
        rec['DATE']=datetime.datetime.strptime(rec['EDAT'].split(" ")[0],'%Y/%m/%d')
    return render_template('publication_list.html',records=records)

def page(path):
    page = pages.get_or_404(path)
    template = page.meta.get('template', 'index2.html')
    return render_template(template, page=page)

if __name__ == "__main__":
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.