Package trac :: Package web :: Module main

Module main

source code

Classes
  FakeSession
  FakePerm
  RequestDispatcher
Web request dispatcher.
Functions
 
populate_hdf(hdf, env, req=None)
Populate the HDF data set with various information, such as common URLs, project information and request-related information.
source code
 
dispatch_request(environ, start_response)
Main entry point for the Trac web interface.
source code
 
send_internal_error(env, req, exc_info) source code
 
send_project_index(environ, start_response, parent_dir=None, env_paths=None) source code
 
get_tracignore_patterns(env_parent_dir)
Return the list of patterns from env_parent_dir/.tracignore or a default pattern of ".*" if the file doesn't exist.
source code
 
get_environments(environ, warn=False)
Retrieve canonical environment name to path mapping.
source code
Variables
  default_tracker = 'http://trac.edgewall.org'
This URL is used for semi-automatic bug reports (see send_internal_error).
  HTTP_STATUS = {100: 'Continue', 101: 'Switching Protocols', 20...
  __package__ = 'trac.web'
  description = 'Cannot fulfill request.'
  empty = u''
  reason = 'HTTP Version Not Supported'

Imports: cgi, dircache, fnmatch, gc, locale, os, pkg_resources, pformat, pprint, re, sys, Markup, Fragment, tag, DocType, TemplateLoader, TRAC_VERSION, ExtensionOption, Option, OrderedExtensionsOption, open_environment, get_plugin_info, match_plugins_to_frames, PermissionCache, PermissionError, ResourceNotFound, arity, get_frame_info, get_last_traceback, hex_entropy, read_file, translation, any, partial, threading, format_datetime, http_date, localtz, timezone, exception_to_unicode, shorten_line, to_unicode, _, get_negotiated_locale, has_babel, safefmt, tag_, Chrome, HDFWrapper, Href, Session, BaseCookie, BaseHTTPRequestHandler, Component, Cookie, CookieError, ExtensionPoint, HTTPBadGateway, HTTPBadRequest, HTTPConflict, HTTPException, HTTPExpectationFailed, HTTPForbidden, HTTPGatewayTimeout, HTTPGone, HTTPInternalError, HTTPLengthRequired, HTTPMethodNotAllowed, HTTPNotAcceptable, HTTPNotFound, HTTPNotImplemented, HTTPPaymentRequired, HTTPPreconditionFailed, HTTPProxyAuthenticationRequired, HTTPRequestEntityTooLarge, HTTPRequestTimeout, HTTPRequestUriTooLong, HTTPRequestedRangeNotSatisfiable, HTTPServiceUnavailable, HTTPUnauthorized, HTTPUnsupportedMediaType, HTTPVersionNotSupported, IAuthenticator, IRequestFilter, IRequestHandler, ITemplateStreamFilter, Interface, Request, RequestDone, SimpleCookie, StringIO, TracError, arg_list_to_args, datetime, errno, implements, md5, mimetypes, new, parse_arg_list, socket, unquote, urlparse


Function Details

dispatch_request(environ, start_response)

source code 

Main entry point for the Trac web interface.

@param environ: the WSGI environment dict @param start_response: the WSGI callback for starting the response

get_environments(environ, warn=False)

source code 

Retrieve canonical environment name to path mapping.

The environments may not be all valid environments, but they are good candidates.


Variables Details

default_tracker

This URL is used for semi-automatic bug reports (see send_internal_error). Please modify it to point to your own Trac instance if you distribute a patched version of Trac.
Value:
'http://trac.edgewall.org'

HTTP_STATUS

Value:
{100: 'Continue',
 101: 'Switching Protocols',
 200: 'Ok',
 201: 'Created',
 202: 'Accepted',
 203: 'Non-Authoritative Information',
 204: 'No Content',
 205: 'Reset Content',
...