Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/rev/e885f84cf19b
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 00:48:33 2012
Кодировка:
allpy: e885f84cf19b

allpy

changeset 923:e885f84cf19b

Moved allpy.fileio.bio.BioPythonFile.supports (which was static method) -> allpy.fileio.bio.supports (which is logical)
author Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru>
date Fri, 04 Nov 2011 11:02:26 +0300
parents 679e0ca2aa61
children 18f74e3bce20
files allpy/fileio/auto.py allpy/fileio/bio.py
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/allpy/fileio/auto.py	Fri Nov 04 00:42:37 2011 +0300
     1.2 +++ b/allpy/fileio/auto.py	Fri Nov 04 11:02:26 2011 +0300
     1.3 @@ -13,7 +13,7 @@
     1.4          elif format.startswith('markup:'):
     1.5              subformat = format.split(':',1)[1]
     1.6              return markup.MarkupFile(file, format=subformat, **kw)
     1.7 -        elif bio.enabled and bio.BioPythonFile.supports(format):
     1.8 +        elif bio.enabled and bio.supports(format):
     1.9              return bio.BioPythonFile(file, format, **kw)
    1.10          elif emboss.enabled:
    1.11              return emboss.EmbossFile(file, format, **kw)
     2.1 --- a/allpy/fileio/bio.py	Fri Nov 04 00:42:37 2011 +0300
     2.2 +++ b/allpy/fileio/bio.py	Fri Nov 04 11:02:26 2011 +0300
     2.3 @@ -6,16 +6,17 @@
     2.4  
     2.5  from common import AlignmentFile
     2.6  
     2.7 +def supports(format):
     2.8 +    """Tell what formats this method supports."""
     2.9 +    return (
    2.10 +        format in AlignIO._FormatToWriter
    2.11 +        or format in SeqIO._FormatToWriter
    2.12 +    )
    2.13 +
    2.14  class BioPythonFile(AlignmentFile):
    2.15      """Parser & writer for file formats supporte by Bio python."""
    2.16  
    2.17 -    @staticmethod
    2.18 -    def supports(format):
    2.19 -        """Tell what formats this method supports."""
    2.20 -        return (
    2.21 -            format in AlignIO._FormatToWriter
    2.22 -            or format in SeqIO._FormatToWriter
    2.23 -        )
    2.24 +    supports = staticmethod(supports)
    2.25  
    2.26      def write_strings(self, sequences):
    2.27          """Write sequences to file."""