コード例 #1
0
ファイル: PhyloXMLIO.py プロジェクト: gitly110/python_exc
def _serialize(value):
    """Convert a Python primitive to a phyloXML-compatible Unicode string (PRIVATE)."""
    if isinstance(value, float):
        return unicode(value).upper()
    elif isinstance(value, bool):
        return unicode(value).lower()
    return unicode(value)
コード例 #2
0
ファイル: blast_xml.py プロジェクト: stxinsite/biopython
 def characters(self, content):
     """Replace quotes and apostrophe."""
     content = escape(unicode(content))
     for a, b in ((u'"', u'"'), (u"'", u''')):
         content = content.replace(a, b)
     self.write(content)
コード例 #3
0
ファイル: blast_xml.py プロジェクト: harshberia93/biopython
 def characters(self, content):
     content = escape(unicode(content))
     for a, b in ((u'"', u'"'), (u"'", u''')):
         content = content.replace(a, b)
     self.write(content)
コード例 #4
0
ファイル: BaseTree.py プロジェクト: gavieira/mitomaker
 def match(node):
     return unicode(node) == target
コード例 #5
0
ファイル: BaseTree.py プロジェクト: gavieira/mitomaker
 def pair_as_kwarg_string(key, val):
     if isinstance(val, basestring):
         return "%s='%s'" % (key,
                             _utils.trim_str(unicode(val), 60, u'...'))
     return "%s=%s" % (key, val)
コード例 #6
0
ファイル: BaseTree.py プロジェクト: rogeriofalcone/biopython
 def match(node):
     return unicode(node) == target
コード例 #7
0
ファイル: BaseTree.py プロジェクト: rogeriofalcone/biopython
 def pair_as_kwarg_string(key, val):
     if isinstance(val, basestring):
         return "%s='%s'" % (key, _utils.trim_str(unicode(val), 60,
             u'...'))
     return "%s=%s" % (key, val)