예제 #1
0
파일: _base.py 프로젝트: shaung/spyne
    def create_in_document(self, ctx, charset=None):
        """Uses the iterable of string fragments in ``ctx.in_string`` to set
        ``ctx.in_document``."""

        parser = etree.XMLParser(remove_comments=True)

        try:
            ctx.in_document = etree.fromstring(_bytes_join(ctx.in_string), parser)
        except ValueError:
            ctx.in_document = etree.fromstring(_bytes_join(ctx.in_string) \
                                                               .decode(charset),
                                               parser)
예제 #2
0
파일: binary.py 프로젝트: leobispo/spyne
 def from_base64(cls, value):
     return [base64.b64decode(_bytes_join(value))]
예제 #3
0
파일: binary.py 프로젝트: leobispo/spyne
 def to_base64(cls, value):
     return [base64.b64encode(_bytes_join(value))]