<s> import web <EOL> from . import account <EOL> from . flash import flash_processor , get_flashed_messages <EOL> from . models import Workshop <EOL> from . oauth import get_oauth_services <EOL> from . template import render_template , context_processor <EOL> urls = ( ) <EOL> def add_urls ( module ) : <EOL> global urls <EOL> module_urls = [ ] <EOL> for path , classname in web . group ( module . urls , <NUM_LIT:2> ) : <EOL> classname = module . __name__ + "<STR_LIT:.>" + classname <EOL> module_urls . extend ( [ path , classname ] ) <EOL> urls = urls + tuple ( module_urls ) <EOL> def load_all_views ( ) : <EOL> from . views import admin <EOL> from . views import auth <EOL> from . views import home <EOL> from . views import orgs <EOL> from . views import about <EOL> from . views import trainers <EOL> from . views import workshops <EOL> add_urls ( admin ) <EOL> add_urls ( auth ) <EOL> add_urls ( home ) <EOL> add_urls ( orgs ) <EOL> add_urls ( about ) <EOL> add_urls ( trainers ) <EOL> add_urls ( workshops ) <EOL> load_all_views ( ) <EOL> app = web . application ( urls , globals ( ) ) <EOL> app . add_processor ( flash_processor ) <EOL> app . notfound = lambda : web . notfound ( render_template ( "<STR_LIT>" ) ) <EOL> app . internalerror = lambda : web . internalerror ( render_template ( "<STR_LIT>" ) ) <EOL> @ context_processor <EOL> def inject_user ( ) : <EOL> user = account . get_current_user ( ) <EOL> return { <EOL> '<STR_LIT:user>' : user , <EOL> '<STR_LIT>' : web . ctx . path , <EOL> '<STR_LIT>' : web . config . get ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : get_flashed_messages , <EOL> '<STR_LIT>' : get_oauth_services , <EOL> '<STR_LIT>' : web . config . get , <EOL> '<STR_LIT>' : lambda : Workshop . findall ( status = '<STR_LIT>' , order = '<STR_LIT:date>' ) , <EOL> '<STR_LIT>' : lambda : Workshop . findall ( status = '<STR_LIT>' , order = '<STR_LIT:date>' ) , <EOL> } </s>
