uw.local.print_.webui package

Submodules

uw.local.print_.webui.authority module

Authorization-related utility routines.

Authorization checkers are provided for admin users, as well as access to orgunits and individual jobs and requisitions.

uw.local.print_.webui.authority.check_admin(environ, cursor, **params)[source]

Check for administrator access.

For use with uw.web.wsgi.authority.check_authority().

uw.local.print_.webui.authority.check_job(environ, cursor, job, **params)[source]

Check for access to a job.

For use with uw.web.wsgi.authority.check_authority().

uw.local.print_.webui.authority.check_orgunit(environ, cursor, orgunit, **params)[source]

Check for access to an orgunit.

For use with uw.web.wsgi.authority.check_authority().

uw.local.print_.webui.authority.check_requisition(environ, cursor, requisition, **params)[source]

Check for access to a requisition.

For use with uw.web.wsgi.authority.check_authority().

uw.local.print_.webui.delegate module

Convenient URL delegators.

These are used to build up the URL structure of the application by analyzing an URL path arc as the ID of an orgunit, job, or requisition.

uw.local.print_.webui.delegate.job_delegate(dir_handler, arc_handler)[source]

Delegate to URL handler based on Job ID in URL.

uw.local.print_.webui.delegate.job_from_arc(arc, cursor, **params)[source]

Interpret a URL path arc as a Job ID.

Parameters
  • arc – the URL path arc.

  • cursor – DB connection cursor.

  • params – any additional context not needed for this arc parser.

Interprets the arc as a numeric Job ID, and obtains the job information.

uw.local.print_.webui.delegate.orgunit_delegate(dir_handler, arc_handler)[source]

Delegate to URL handler based on orgunit in URL.

uw.local.print_.webui.delegate.orgunit_from_arc(arc, cursor, **params)[source]

Interpret a URL path arc as an orgunit.

Parameters
  • arc – the URL path arc.

  • cursor – DB connection cursor.

  • params – any additional context not needed for this arc parser.

Simply checks that the arc is a potentially valid orgunit, i.e., four decimal digits, and returns it unmodified.

uw.local.print_.webui.delegate.requisition_delegate(dir_handler, arc_handler)[source]

Delegate to URL handler based on Requisition ID in URL.

uw.local.print_.webui.delegate.requisition_from_arc(arc, cursor, **params)[source]

Interpret a URL path arc as a Requisition ID.

Parameters
  • arc – the URL path arc.

  • cursor – DB connection cursor.

  • params – any additional context not needed for this arc parser.

Interprets the arc as a Requisition ID, and obtains the requisition information. The ID is at least six decimal digits preceded by an ‘R’.

uw.local.print_.webui.job module

Job-related URL handlers.

URL handlers for listing jobs and viewing individual jobs.

uw.local.print_.webui.job.format_jobs(jobs, baseurl='')[source]

Format some jobs as an HTML table.

Parameters
  • jobs – an iterable of job information.

  • baseurl – the base URL of the application.

Generates an HTML table with columns for the Job ID, when it was created, its current status, a link to the associated requisition PDF if any, and the job title.

uw.local.print_.webui.job.format_status(r)[source]

Format the job status table column.

Parameters

r – information about a job.

Displays the most advanced available one of five possible date fields. Usually this will be “Files Sent” because the time between a job being marked “Ready” and the rest of the process completing is usually short. Jobs that are “Cancelled” will also stay that way indefinitely. Other status values should show up only briefly after the job is marked “Ready”.

uw.local.print_.webui.orgunit module

Orgunit-related URL handlers.

URL handlers for listing relevant orgunits and displaying job associated with individual orgunits.

uw.local.print_.webui.requisition module

Requisition-related URL handlers.

URL handlers for listing requisitions and viewing individual requisitions.

uw.local.print_.webui.requisition.format_requisitions(requisitions)[source]

Format some requisitions as an HTML table.

Parameters

requisitions – an iterable of requisition information.

Generates an HTML table with columns for the ID, title, link to PDF, when it arrived, and the related job if any.

uw.local.print_.webui.wsgifunc module

Overall URL structure for Web UI.

This module defines the overall URL structure of the Print application in the wsgifunc function. It also implements the handler for the top-level URL of the application.

Module contents

Web UI implementation for Print.

This package implements the Web interface for the printing interface. The overall URL structure is defined by wsgifunc.py.