Home | Trees | Indices | Help |
|
---|
|
The TurboGears utility module.
Classes | |
Bunch Simple but handy collector of a bunch of named stuff. |
|
DictObj | |
DictWrapper | |
setlike Set preserving item order. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
quote_cookie | |
unquote_cookie |
Function Details |
Decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used. Inspired by http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/391367 |
True immutable symbolic enumeration with qualified value access. Written by Zoran Isailovski: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486 |
Try to update the project settings from the config file specified. If configfile is |
Remove unsupported func arguments from given args list and kw dict. @param func: the callable to inspect for supported arguments @type func: callable @param args: the names of the positional arguments intended to be passed to func @type args: list @param kw: the keyword arguments intended to be passed to func @type kw: dict @keyparam start: the number of items from the start of the argument list of func to disregard. Set start=1 to use adapt_call on a bound method to disregard the implicit self argument. @type start: int Returns args list and kw dict from which arguments unsupported by func have been removed. The passed in kw dict is also stripped as a side-effect. The returned objects can then be used to call the target function. Example: def myfunc(arg1, arg2, kwarg1='foo'): pass args, kw = adapt_call(myfunc, ['args1, 'bogus1'], {'kwargs1': 'bar', 'bogus2': 'spamm'}) # --> ['args1'], {'kwargs1': 'bar'} myfunc(*args, **kw) |
Pop a value from a nested parameter dictionary. You must pass a list or dotted key as the key chain to the value. If a value for this key chain is found, it will be removed and the value will be returned. If this creates empty subkeys, these will also be removed. If no single value is associated with the key chain, then None will be returned. |
Load a class from a module in dotted-path notation. E.g.: load_class("package.module.class"). Based on recipe 16.3 from Python Cookbook, 2ed., by Alex Martelli, Anna Martelli Ravenscroft, and David Ascher (O'Reilly Media, 2005) |
Parse an HTTP Accept header (RFC 2616) into a sorted list. The quality factors in the header determine the sort order. The values can include possible media-range parameters. This function can also be used for the Accept-Charset, Accept-Encoding and Accept-Language headers. |
Parse an HTTP Accept header (RFC 2616) into a preferred value. The quality factors in the header determine the preference. Possible media-range parameters are allowed, but will be ignored. This function can also be used for the Accept-Charset, Accept-Encoding and Accept-Language headers. This is similar to parse_http_accept_header(accept)[0], but faster. |
Convert encoded string to unicode string. Uses get_template_encoding_default() to guess source string encoding. Handles turbogears.i18n.lazystring correctly. |
Convert a unicode string to utf-8 encoded plain string. Handles turbogears.i18n.lazystring correctly. Does nothing to already encoded string. |
Return default MIME media type for a template format. Note: By default we are serving xhtml as "text/html" instead of the more correct "application/xhtml+xml", since many browsers, particularly MSIE, do not support this. We are assuming that xhtml means XHTML 1.0 here, where this approach is possible. It would be possible to use some kind of content negotiation to deliver a customized content type, but we avoid this because it causes more harm (e.g. with proxies involved) than good. If you want to serve the proper content type (e.g. for XHTML 1.1), set tg.format_mime_types= {'xhtml': 'application/xhtml+xml'}. You can also set a particular content type per controller using the content_type parameter of the expose decorator. For detailed information about this issues, see here: http://www.smackthemouse.com/xhtmlxml, http://schneegans.de/web/xhtml/. |
Return whether the MIME media type supports a charset parameter. Note: According to RFC4627, we do not output a charset parameter for "application/json" (this type always uses a UTF encoding). |
Find precision of some arbitrary value. The main intention for this function is to use it together with turbogears.i18n.format.format_decimal() where one has to inform the precision wanted. So, use it like this: format_decimal(some_number, find_precision(some_number)) |
Make a copy of the value if it is mutable. Returns the value. If feedback is set to true, also returns whether value was mutable as the second element of a tuple. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jul 19 17:17:55 2019 | http://epydoc.sourceforge.net |