Package logilab-common-0 :: Package 36 :: Package 1
[frames] | no frames]

Package 1

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

:copyright:
  2000-2008 `LOGILAB S.A. <http://www.logilab.fr>`_ (Paris, FRANCE),
  all rights reserved.

:contact:
  http://www.logilab.org/project/logilab-common --
  mailto:python-projects@logilab.org

:license:
  `General Public License version 2
  <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>`_

Submodules

Classes
  attrdict
A dictionary for which keys are also accessible as attributes.
  nullobject
Functions
 
intersection(list1, list2)
Return the intersection of list1 and list2.
source code
 
difference(list1, list2)
Return elements of list1 not in list2.
source code
 
union(list1, list2)
Return list1 union list2.
source code
 
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
  STD_BLACKLIST = 'CVS', '.svn', '.hg', 'debian', 'dist', 'build'
  IGNORED_EXTENSIONS = '.pyc', '.pyo', '.elc', '~'
  get_cycles = moved('logilab.common.graph', 'get_cycles')
  cached = moved('logilab.common.decorators', 'cached')
  ProgressBar = moved('logilab.common.shellutils', 'ProgressBar')
  Execute = moved('logilab.common.shellutils', 'Execute')
  acquire_lock = moved('logilab.common.shellutils', 'acquire_lock')
  release_lock = moved('logilab.common.shellutils', 'release_lock')
  deprecated_function = moved('logilab.common.deprecation', 'dep...
  class_renamed = moved('logilab.common.deprecation', 'class_ren...
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

deprecated_function

Value:
moved('logilab.common.deprecation', 'deprecated_function')

class_renamed

Value:
moved('logilab.common.deprecation', 'class_renamed')