def end_string( self, data ): if self._encoding: data = xmlrpclib._decode( data, self._encoding ) str = xmlrpclib._stringify( data ) if type( str ) == type( u'' ): str = str.encode( self.resultencoding ) self.append( str ) self._value = 0
def end_struct(self, data): mark = self._marks.pop() # map structs to Python dictionaries dct = {} items = self._stack[mark:] for i in range(0, len(items), 2): dct[xmlrpclib._stringify(items[i])] = items[i + 1] dct = XMLRPCDecoder()(dct) self._stack[mark:] = [dct] self._value = 0
def end_struct(self, data): mark = self._marks.pop() # map structs to Python dictionaries d = {} items = self._stack[mark:] for i in range(0, len(items), 2): d[_pyxmlrpc._stringify(items[i])] = items[i + 1] if d.get('edt__typ', None): # Hook for ElementalDataType support. d = edt_decode(d) self._stack[mark:] = [d] self._value = 0
def end_struct(self, data): mark = self._marks.pop() # map structs to Python dictionaries d = {} items = self._stack[mark:] for i in range(0, len(items), 2): d[_pyxmlrpc._stringify(items[i])] = items[i+1] if d.get('edt__typ',None): # Hook for ElementalDataType support. d = edt_decode(d) self._stack[mark:] = [d] self._value = 0
def end_struct(self, data): mark = self._marks.pop() # map structs to Python dictionaries dct = {} items = self._stack[mark:] for i in range(0, len(items), 2): dct[xmlrpclib._stringify(items[i])] = items[i + 1] if '__class__' in dct: if dct['__class__'] == 'date': dct = datetime.date(dct['year'], dct['month'], dct['day']) elif dct['__class__'] == 'time': dct = datetime.time(dct['hour'], dct['minute'], dct['second']) elif dct['__class__'] == 'Decimal': dct = Decimal(dct['decimal']) self._stack[mark:] = [dct] self._value = 0
def end_struct(self, data): mark = self._marks.pop() # map structs to Python dictionaries dct = {} items = self._stack[mark:] for i in range(0, len(items), 2): dct[xmlrpclib._stringify(items[i])] = items[i + 1] if "__class__" in dct: if dct["__class__"] == "date": dct = datetime.date(dct["year"], dct["month"], dct["day"]) elif dct["__class__"] == "time": dct = datetime.time(dct["hour"], dct["minute"], dct["second"]) elif dct["__class__"] == "Decimal": dct = Decimal(dct["decimal"]) self._stack[mark:] = [dct] self._value = 0
def decode_struct(unmarsh, _): """ Decodes a structure in order to wrap the resulting dictionary in an AttributeDict instance. """ # pylint: disable=W0212 mark = unmarsh._marks.pop() dct = AttributeDict() items = unmarsh._stack[mark:] for i in range(0, len(items), 2): dct[xmlrpclib._stringify(items[i])] = items[i+1] unmarsh._stack[mark:] = [dct] unmarsh._value = 0