Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/diff/7b6907d6d927/allpy/base.py
Дата изменения: Unknown
Дата индексирования: Sun Feb 3 20:16:26 2013
Кодировка:
allpy: allpy/base.py diff

allpy

diff allpy/base.py @ 380:7b6907d6d927

base.Alignment.process allows `function` to override copy_descriptions and copy_contents
author Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru>
date Tue, 01 Feb 2011 18:42:03 +0300
parents 5639138f619a
children d66d470a9c0a
line diff
     1.1 --- a/allpy/base.py	Tue Feb 01 18:36:26 2011 +0300
     1.2 +++ b/allpy/base.py	Tue Feb 01 18:42:03 2011 +0300
     1.3 @@ -373,8 +373,15 @@
     1.4          - `function(block)` must return block with same line order.
     1.5          - if `copy_descriptions` is False, ignore new sequence names.
     1.6          - if `copy_contents` is False, don't copy sequence contents too.
     1.7 +
     1.8 +        `function` (object) may have attributes `copy_descriptions` and
     1.9 +        `copy_contents`, which override the same named arguments.
    1.10          """
    1.11          new = function(self)
    1.12 +        if hasattr(function, 'copy_descriptions'):
    1.13 +            copy_descriptions = function.copy_descriptions
    1.14 +        if hasattr(function, 'copy_contents'):
    1.15 +            copy_contents = function.copy_contents
    1.16          self._replace_contents(new, copy_descriptions, copy_contents)
    1.17  
    1.18  class Column(dict):