Ejemplo n.º 1
0
Archivo: _base.py Proyecto: rch/rpclib
    def create_in_document(self, ctx, charset=None):
        """Uses the iterable of string fragments in ``ctx.in_string`` to set
        ``ctx.in_document``."""

        try:
            ctx.in_document = etree.fromstring(_bytes_join(ctx.in_string))
        except ValueError:
            ctx.in_document = etree.fromstring(_bytes_join([s.decode(charset) for s in ctx.in_string]))
Ejemplo n.º 2
0
Archivo: _base.py Proyecto: rch/rpclib
    def create_in_document(self, ctx, charset=None):
        """Uses the iterable of string fragments in ``ctx.in_string`` to set
        ``ctx.in_document``."""

        try:
            ctx.in_document = etree.fromstring(_bytes_join(ctx.in_string))
        except ValueError:
            ctx.in_document = etree.fromstring(_bytes_join([s.decode(charset)
                                                        for s in ctx.in_string]))
Ejemplo n.º 3
0
 def from_base64(cls, value):
     return [base64.b64decode(_bytes_join(value))]
Ejemplo n.º 4
0
 def to_base64(cls, value):
     return [base64.b64encode(_bytes_join(value))]
Ejemplo n.º 5
0
Archivo: binary.py Proyecto: rch/rpclib
 def from_base64(cls, value):
     return [base64.b64decode(_bytes_join(value))]
Ejemplo n.º 6
0
Archivo: binary.py Proyecto: rch/rpclib
 def to_base64(cls, value):
     return [base64.b64encode(_bytes_join(value))]