Package trac :: Package web :: Module chrome :: Class Chrome

Class Chrome

source code

    object --+    
             |    
core.Component --+
                 |
                Chrome

Web site chrome assembly manager.

Chrome is everything that is not actual page content.

Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
 
get_system_info(self) source code
 
environment_created(self)
Create the environment templates directory.
source code
 
environment_needs_upgrade(self, db) source code
 
upgrade_environment(self, db) source code
 
match_request(self, req) source code
 
process_request(self, req) source code
 
get_htdocs_dirs(self) source code
 
get_templates_dirs(self) source code
 
get_wiki_syntax(self) source code
 
get_link_resolvers(self) source code
 
get_all_templates_dirs(self)
Return a list of the names of all known templates directories.
source code
 
prepare_request(self, req, handler=None)
Prepare the basic chrome data for the request.
source code
 
get_icon_data(self, req) source code
 
get_logo_data(self, href, abs_href=None) source code
 
populate_data(self, req, data) source code
 
load_template(self, filename, method=None)
Retrieve a Template and optionally preset the template data.
source code
 
render_template(self, req, filename, data, content_type=None, fragment=False, iterable=False)
Render the filename using the data for the context.
source code
 
get_interface_customization_files(self)
Returns a dictionary containing the lists of files present in the site and shared templates and htdocs directories.
source code
 
iterable_content(self, stream, method, **kwargs)
Generate an iterable object which iterates str instances from the given stream instance.
source code
 
cc_list(self, cc_field)
Split a CC: value in a list of addresses.
source code
 
format_emails(self, context, value, sep=', ')
Normalize a list of e-mails and obfuscate them if needed.
source code
 
authorinfo(self, req, author, email_map=None) source code
 
get_email_map(self)
Get the email addresses of all known users.
source code
 
authorinfo_short(self, author) source code
 
format_author(self, req, author) source code
 
add_textarea_grips(self, req)
Make <textarea class="trac-resizable"> fields resizable if enabled by configuration.
source code
 
add_wiki_toolbars(self, req)
Add wiki toolbars to <textarea class="wikitext"> fields.
source code
 
add_auto_preview(self, req)
Setup auto-preview for <textarea> fields.
source code
 
add_jquery_ui(self, req)
Add a reference to the jQuery UI script and link the stylesheet.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods

Inherited from core.Component: implements

Class Variables
  required = True
  shared_templates_dir = <PathOption [inherit] "templates_dir">
  shared_htdocs_dir = <PathOption [inherit] "htdocs_dir">
  auto_reload = <BoolOption [trac] "auto_reload">
  genshi_cache_size = <IntOption [trac] "genshi_cache_size">
  htdocs_location = <Option [trac] "htdocs_location">
  jquery_location = <Option [trac] "jquery_location">
  jquery_ui_location = <Option [trac] "jquery_ui_location">
  jquery_ui_theme_location = <Option [trac] "jquery_ui_theme_loc...
  metanav_order = <ListOption [trac] "metanav">
  mainnav_order = <ListOption [trac] "mainnav">
  logo_link = <Option [header_logo] "link">
  logo_src = <Option [header_logo] "src">
  logo_alt = <Option [header_logo] "alt">
  logo_width = <IntOption [header_logo] "width">
  logo_height = <IntOption [header_logo] "height">
  show_email_addresses = <BoolOption [trac] "show_email_addresses">
  never_obfuscate_mailto = <BoolOption [trac] "never_obfuscate_m...
  show_ip_addresses = <BoolOption [trac] "show_ip_addresses">
  resizable_textareas = <BoolOption [trac] "resizable_textareas">
  wiki_toolbars = <BoolOption [trac] "wiki_toolbars">
  auto_preview_timeout = <FloatOption [trac] "auto_preview_timeo...
  default_dateinfo_format = <Option [trac] "default_dateinfo_for...
  use_chunked_encoding = <BoolOption [trac] "use_chunked_encoding">
  templates = None
hash(x)
  html_doctype = ('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'h...
Properties
  navigation_contributors
List of components that implement ~trac.web.chrome.INavigationContributor
  template_providers
List of components that implement ~trac.web.chrome.ITemplateProvider
  stream_filters
List of components that implement ~trac.web.api.ITemplateStreamFilter

Inherited from object: __class__

Method Details

prepare_request(self, req, handler=None)

source code 
Prepare the basic chrome data for the request.
Parameters:
  • req - the request object
  • handler - the IRequestHandler instance that is processing the request

load_template(self, filename, method=None)

source code 

Retrieve a Template and optionally preset the template data.

Also, if the optional method argument is set to 'text', a NewTextTemplate instance will be created instead of a MarkupTemplate.

render_template(self, req, filename, data, content_type=None, fragment=False, iterable=False)

source code 

Render the filename using the data for the context.

The content_type argument is used to choose the kind of template used (NewTextTemplate if 'text/plain', MarkupTemplate otherwise), and tweak the rendering process. Doctype for 'text/html' can be specified by setting the html_doctype attribute (default is XHTML_STRICT)

When fragment is specified, the (filtered) Genshi stream is returned.

When iterable is specified, the content as an iterable instance which is generated from filtered Genshi stream is returned.

iterable_content(self, stream, method, **kwargs)

source code 
Generate an iterable object which iterates str instances from the given stream instance.
Parameters:
  • method - the serialization method; can be either "xml", "xhtml", "html", "text", or a custom serializer class

format_emails(self, context, value, sep=', ')

source code 
Normalize a list of e-mails and obfuscate them if needed.
Parameters:
  • context - the context in which the check for obfuscation should be done
  • value - a string containing a comma-separated list of e-mails
  • sep - the separator to use when rendering the list again

Class Variable Details

jquery_ui_theme_location

Value:
<Option [trac] "jquery_ui_theme_location">

never_obfuscate_mailto

Value:
<BoolOption [trac] "never_obfuscate_mailto">

auto_preview_timeout

Value:
<FloatOption [trac] "auto_preview_timeout">

default_dateinfo_format

Value:
<Option [trac] "default_dateinfo_format">

html_doctype

Value:
('html',
 '-//W3C//DTD XHTML 1.0 Strict//EN',
 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd')

Property Details

navigation_contributors

List of components that implement ~trac.web.chrome.INavigationContributor
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.

template_providers

List of components that implement ~trac.web.chrome.ITemplateProvider
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.

stream_filters

List of components that implement ~trac.web.api.ITemplateStreamFilter
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.