def _require_post_load_hook(action, *args, **kwargs):
 if (action == 'back'):
  return
 from twill import commands
 OUT = commands.OUT
 global ignore_once
 global ignore_always
 if (ignore_once or ignore_always):
  ignore_once = False
  return
 for what in _requirements:
  if (what == 'success'):
   if DEBUG:
    print >>OUT, 'REQUIRING success'
   commands.code(200)
  elif (what == 'links_ok'):
   from check_links import check_links
   ignore_always = True
   if DEBUG:
    print >>OUT, 'REQUIRING functioning links'
    print >>OUT, '(already visited:)'
    print '\n DCTB '.join(links_visited.keys())
   try:
    check_links(visited=links_visited)
   finally:
    ignore_always = False

def _require_post_load_hook ( action , * args , ** kwargs ) : if ( action == 'back' ) : return from twill import commands OUT = commands . OUT global ignore_once global ignore_always if ( ignore_once or ignore_always ) : ignore_once = False return for what in _requirements : if ( what == 'success' ) : if DEBUG : print >> OUT , 'REQUIRING success' commands . code ( 200 ) elif ( what == 'links_ok' ) : from check_links import check_links ignore_always = True if DEBUG : print >> OUT , 'REQUIRING functioning links' print >> OUT , '(already visited:)' print '\n DCTB ' . join ( links_visited . keys ( ) ) try : check_links ( visited = links_visited ) finally : ignore_always = False
post-load hook function to be called after each page is loaded .