Package logilab :: Package common

[frames] | no frames]

# Package common

source code

    Logilab common library (aka Logilab's extension to the standard library).

    :type STD_BLACKLIST: tuple
    :var STD_BLACKLIST: directories ignored by default by the functions in
      this package which have to recurse into directories

    :type IGNORED_EXTENSIONS: tuple
    :var IGNORED_EXTENSIONS: file extensions that may usually be ignored

Submodules

- logilab.common.cache: Cache module, with a least recently used algorithm for the management of the deletion of entries.
- logilab.common.changelog: Manipulation of upstream change log files.
- logilab.common.clcommands: Helper functions to support command line tools providing more than one command.
- logilab.common.compat: Wrappers around some builtins introduced in python 2.3, 2.4 and 2.5, making them available in for earlier versions of python.
- logilab.common.configuration: Classes to handle advanced configuration in simple to complex applications.
- logilab.common.daemon: A daemonize function (for Unices)
- logilab.common.date: Date manipulation helper functions.
- logilab.common.debugger: Customized version of pdb's default debugger.
- logilab.common.decorators: A few useful function/method decorators.
- logilab.common.deprecation: Deprecation utilities.
- logilab.common.fileutils: File and file-path manipulation utilities.
- logilab.common.graph: Graph manipulation utilities.
- logilab.common.interface: Bases class for interfaces to provide 'light' interface handling.
- logilab.common.logging_ext: Extends the logging module from the standard library.
- logilab.common.modutils: Python modules manipulation utility functions.
- logilab.common.optik_ext: Add an abstraction level to transparently import optik classes from optparse (python >= 2.3) or the optik package.
- logilab.common.optparser: Extend OptionParser with commands.
- logilab.common.proc: module providing: * process information (linux specific: rely on /proc) * a class for resource control (memory / time / cpu time)
- logilab.common.registry: This module provides bases for predicates dispatching (the pattern in use here is similar to what's refered as multi-dispatch or predicate-dispatch in the literature, though a bit different since the idea is to select across different implementation 'e.g.
- logilab.common.shellutils: shell/term utilities, useful to write some python scripts instead of shell scripts.
- logilab.common.sphinx_ext
- logilab.common.sphinxutils: Sphinx utils
- logilab.common.table: Table management module.
- logilab.common.tasksqueue: Prioritized tasks queue
- logilab.common.textutils: Some text manipulation utility functions.
- logilab.common.tree: Base class to represent a tree structure.
- logilab.common.umessage: Unicode email support (extends email from stdlib)
- logilab.common.ureports: Universal report objects and some formatting drivers.
  - logilab.common.ureports.docbook_writer: HTML formatting drivers for ureports
  - logilab.common.ureports.html_writer: HTML formatting drivers for ureports
  - logilab.common.ureports.nodes: Micro reports objects.
  - logilab.common.ureports.text_writer: Text formatting drivers for ureports
- logilab.common.urllib2ext
- logilab.common.vcgutils: Functions to generate files readable with Georg Sander's vcg (Visualization of Compiler Graphs).
- logilab.common.visitor: A generic visitor abstract implementation.
- logilab.common.xmlutils: XML utilities.

Classes
| attrdict A dictionary for which keys are also accessible as attributes.
| dictattr
| nullobject
| tempattr

Functions

flatten(iterable, tr_func=None, results=None) Flatten a list of list with any level. | source code

make_domains(lists) Given a list of lists, return a list of domain for each list to produce all combinations of possibles values. | source code

Variables
| __pkginfo__ = `types.ModuleType('__pkginfo__')`
| STD_BLACKLIST = `'CVS', '.svn', '.hg', '.git', '.tox', 'debian'`...``
| IGNORED_EXTENSIONS = `'.pyc', '.pyo', '.elc', '~', '.swp', '.orig'`
| USE_MX_DATETIME = `True`

Function Details

### flatten(iterable, tr_func=None, results=None)

source code

    Flatten a list of list with any level.

    If tr_func is not None, it should be a one argument function that'll be called
    on each final element.

    :rtype: list

    >>> flatten([1, [2, 3]])
    [1, 2, 3]

### make_domains(lists)

source code

    Given a list of lists, return a list of domain for each list to produce all
    combinations of possibles values.

    :rtype: list

    Example:

    >>> make_domains(['a', 'b'], ['c','d', 'e'])
    [['a', 'b', 'a', 'b', 'a', 'b'], ['c', 'c', 'd', 'd', 'e', 'e']]

Variables Details

### STD_BLACKLIST

Value:

      'CVS', '.svn', '.hg', '.git', '.tox', 'debian', 'dist', 'build'