(self)
return ctx
Convert a structure into a Python native type.
Convert a structure into a Python native type.
Convert a structure into a Python native type .
def to_dict(self):
        'Convert a structure into a Python native type.'
        ctx = Context()
        ContextFlags = self.ContextFlags
        ctx['ContextFlags'] = ContextFlags
        if (ContextFlags & CONTEXT_DEBUG_REGISTERS) == CONTEXT_DEBUG_REGISTERS:
            for key in self._ctx_debug:
                ctx[key] = getattr(self, key)
        if (ContextFlags & CONTEXT_FLOATING_POINT) == CONTEXT_FLOATING_POINT:
            ctx['FloatSave'] = self.FloatSave.to_dict()
        if (ContextFlags & CONTEXT_SEGMENTS) == CONTEXT_SEGMENTS:
            for key in self._ctx_segs:
                ctx[key] = getattr(self, key)
        if (ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER:
            for key in self._ctx_int:
                ctx[key] = getattr(self, key)
        if (ContextFlags & CONTEXT_CONTROL) == CONTEXT_CONTROL:
            for key in self._ctx_ctrl:
                ctx[key] = getattr(self, key)
        if (ContextFlags & CONTEXT_EXTENDED_REGISTERS) == CONTEXT_EXTENDED_REGISTERS:
            er = [ self.ExtendedRegisters[index] for index in compat.xrange(0, MAXIMUM_SUPPORTED_EXTENSION) ]
            er = tuple(er)
            ctx['ExtendedRegisters'] = er
        return ctx
def to_dict ( self ) : ctx = Context ( ) ContextFlags = self . ContextFlags ctx [ 'ContextFlags' ] = ContextFlags if ( ContextFlags & CONTEXT_DEBUG_REGISTERS ) == CONTEXT_DEBUG_REGISTERS : for key in self . _ctx_debug : ctx [ key ] = getattr ( self , key ) if ( ContextFlags & CONTEXT_FLOATING_POINT ) == CONTEXT_FLOATING_POINT : ctx [ 'FloatSave' ] = self . FloatSave . to_dict ( ) if ( ContextFlags & CONTEXT_SEGMENTS ) == CONTEXT_SEGMENTS : for key in self . _ctx_segs : ctx [ key ] = getattr ( self , key ) if ( ContextFlags & CONTEXT_INTEGER ) == CONTEXT_INTEGER : for key in self . _ctx_int : ctx [ key ] = getattr ( self , key ) if ( ContextFlags & CONTEXT_CONTROL ) == CONTEXT_CONTROL : for key in self . _ctx_ctrl : ctx [ key ] = getattr ( self , key ) if ( ContextFlags & CONTEXT_EXTENDED_REGISTERS ) == CONTEXT_EXTENDED_REGISTERS : er = [ self . ExtendedRegisters [ index ] for index in compat . xrange ( 0 , MAXIMUM_SUPPORTED_EXTENSION ) ] er = tuple ( er ) ctx [ 'ExtendedRegisters' ] = er return ctx