Edgewall Software
Please note:

The documentation here is generated live, in a way that is neither comprehensive nor 100% correct. We strongly recommend using the HTML documentation included with the source tarballs instead.

babel.util

Various utility classes and functions.

parse_encoding(fp)

Deduce the encoding of a source file from magic comment.

It does this in the same way as the Python interpreter

The fp argument should be a seekable file object.

(From Jeff Dairiki)

pathmatch(pattern, filename)

Extended pathname pattern matching.

This function is similar to what is provided by the fnmatch module in the Python standard library, but:

  • can match complete (relative or absolute) path names, and not just file names, and
  • also supports a convenience pattern ("**") to match files at any directory level.

Examples:

>>> pathmatch('**.py', 'bar.py')
True
>>> pathmatch('**.py', 'foo/bar/baz.py')
True
>>> pathmatch('**.py', 'templates/index.html')
False
>>> pathmatch('**/templates/*.html', 'templates/index.html')
True
>>> pathmatch('**/templates/*.html', 'templates/foo/bar.html')
False
param pattern:the glob pattern
param filename:the path name of the file to match against
return:True if the path name matches the pattern, False otherwise
rtype:bool

odict

Ordered dict implementation.

see:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747

clear(self)

(Not documented)

copy(self)

(Not documented)

items(self)

(Not documented)

keys(self)

(Not documented)

setdefault(self, key, failobj=None)

(Not documented)

update(self, dict)

(Not documented)

values(self)

(Not documented)

FixedOffsetTimezone

Fixed offset in minutes east from UTC.

utcoffset(self, dt)

(Not documented)

tzname(self, dt)

(Not documented)

dst(self, dt)

(Not documented)

LocalTimezone

(Not documented)

utcoffset(self, dt)

(Not documented)

dst(self, dt)

(Not documented)

tzname(self, dt)

(Not documented)


See ApiDocs/0.8, Documentation

Last modified 16 months ago Last modified on Dec 10, 2015 6:25:47 AM