Skip to content

Latest commit

 

History

History
80 lines (73 loc) · 2.69 KB

devdoc.org

File metadata and controls

80 lines (73 loc) · 2.69 KB

awt.py

The core script.

base.html

The core/base html. This is where <html>, <head> and <body> are.

Child pages

default-index.html

This child handles requests for “/”

results-index.html

This is the driver behind “/awt” and “/id”

tag-index.html

This is the driver behind “/tag”

not-found.html

This gets rendered as a subtemplate of base.html when an invalid URL is given.

Snippets shown on many child pages

intro-snippet.html

This is the intro at the beginning of every page, but I’m going to push it into base.html.

abifbox-snippet.html

This is the text-entry box shown when the user is being invited to modify some ABIF.

also-note-snippet.html

This is shown at the bottom of many pages

footer.snippet.html

This is a footer that shows up on all pages

Snippets geared toward tag-index

all-snippet.html

This is part of a subpage of tag-index.html. It iterates from 6 until the end of list abif files associated with the current tag

example-list-snippet.html

This is part of a subpage of tag-index.html. It iterates through all of the examples and provides “/id”-based links

Snippets specific to certain result-types

irv-snippet.html

This is part of a subpage of results-index.html This snippet that gets pulled in when IRV results are requested. It contains a bit of style used in templates that should probably be copied elsewhere.

star-snippet.html

This is part of a subpage of results-index.html This snippet that gets pulled in when STAR results are requested. It contains a bit of style used in templates that should probably be copied elsewhere.

awt.py structure

class WebEnv (singleton):

wenv(name):

Return name named environment variable from web environment.

wenvDict():

Return dictionary with entire web environment

set_web_env():

sync web environment with WebEnv singleton

supporting functions

build_examplelist():

Load the list of examples from examplelist.yml

get_fileentry_from_examplelist(filekey, examplelist):

Returns entry of ABIF file matching filekey

get_fileentries_by_tag(tag, examplelist):

Returns ABIF file entries having given tag

get_all_tags_in_examplelist(examplelist):

FIXME

add_html_hints_to_stardict(scores, stardict):

FIXME

_get_jabmod_to_eledata(abifstr, stuff_to_get=[‘dot’, ‘wlt’, ‘IRV’, ‘STAR’]):

called by get_by id

Redirect from / to /awt

homepage():

This is a really simple function

/<toppage> (including /awt) and /tag/<tag>

awt_get(toppage=None, tag=None)

This was the original function to handle GET requests. It’s a monolith that probably needs to be broken up

/id/<identifier> GET and /id/<identifier>/<resulttype> GET

get_by_id(identifier, resulttype=None):

/awt POST

awt_post():