Remove unneeded rpc.capnp by fixing ez_restore
This commit is contained in:
@@ -27,6 +27,13 @@ cdef extern from "capnp/schema.h" namespace " ::capnp":
|
|||||||
cdef cppclass StructSchema(Schema):
|
cdef cppclass StructSchema(Schema):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
cdef extern from "capnp/any.h" namespace " ::capnp":
|
||||||
|
cdef cppclass AnyPointer:
|
||||||
|
cppclass Reader:
|
||||||
|
pass
|
||||||
|
cppclass Builder:
|
||||||
|
pass
|
||||||
|
|
||||||
cdef extern from "capnp/blob.h" namespace " ::capnp":
|
cdef extern from "capnp/blob.h" namespace " ::capnp":
|
||||||
cdef cppclass Data:
|
cdef cppclass Data:
|
||||||
cppclass Reader:
|
cppclass Reader:
|
||||||
@@ -655,6 +662,8 @@ cdef extern from "capnp/message.h" namespace " ::capnp":
|
|||||||
DynamicStruct.Builder initRootDynamicStruct'initRoot< ::capnp::DynamicStruct>'(StructSchema)
|
DynamicStruct.Builder initRootDynamicStruct'initRoot< ::capnp::DynamicStruct>'(StructSchema)
|
||||||
void setRootDynamicStruct'setRoot< ::capnp::DynamicStruct::Reader>'(DynamicStruct.Reader)
|
void setRootDynamicStruct'setRoot< ::capnp::DynamicStruct::Reader>'(DynamicStruct.Reader)
|
||||||
|
|
||||||
|
AnyPointer.Builder getRootAnyPointer'getRoot< ::capnp::AnyPointer>'()
|
||||||
|
|
||||||
DynamicOrphan newOrphan'getOrphanage().newOrphan'(StructSchema)
|
DynamicOrphan newOrphan'getOrphanage().newOrphan'(StructSchema)
|
||||||
|
|
||||||
cdef cppclass MessageReader:
|
cdef cppclass MessageReader:
|
||||||
@@ -671,6 +680,7 @@ cdef extern from "capnp/message.h" namespace " ::capnp":
|
|||||||
Annotation.Reader getRootAnnotation'getRoot< ::capnp::schema::Annotation>'()
|
Annotation.Reader getRootAnnotation'getRoot< ::capnp::schema::Annotation>'()
|
||||||
|
|
||||||
DynamicStruct.Reader getRootDynamicStruct'getRoot< ::capnp::DynamicStruct>'(StructSchema)
|
DynamicStruct.Reader getRootDynamicStruct'getRoot< ::capnp::DynamicStruct>'(StructSchema)
|
||||||
|
AnyPointer.Reader getRootAnyPointer'getRoot< ::capnp::AnyPointer>'()
|
||||||
|
|
||||||
cdef cppclass MallocMessageBuilder(MessageBuilder):
|
cdef cppclass MallocMessageBuilder(MessageBuilder):
|
||||||
MallocMessageBuilder()
|
MallocMessageBuilder()
|
||||||
|
|||||||
@@ -1655,13 +1655,12 @@ cdef class TwoPartyClient:
|
|||||||
raise ValueError("objectId unexpectedly was not convertible to the proper type")
|
raise ValueError("objectId unexpectedly was not convertible to the proper type")
|
||||||
|
|
||||||
cpdef ez_restore(self, textId) except +reraise_kj_exception:
|
cpdef ez_restore(self, textId) except +reraise_kj_exception:
|
||||||
import rpc_capnp
|
# ez-rpc from the C++ API uses Text under the hood
|
||||||
# ez-rpc from the C++ API uses SturdyRef.objectId under the hood
|
ref = _MallocMessageBuilder().get_root_as_any()
|
||||||
ref = rpc_capnp.SturdyRef.new_message()
|
|
||||||
# objectId is an AnyPointer, so we have a special method for setting it to text
|
# objectId is an AnyPointer, so we have a special method for setting it to text
|
||||||
ref.objectId.set_as_text(textId)
|
ref.set_as_text(textId)
|
||||||
|
|
||||||
return self.restore(ref.objectId)
|
return self.restore(ref)
|
||||||
|
|
||||||
cdef class TwoPartyServer:
|
cdef class TwoPartyServer:
|
||||||
cdef RpcSystem * thisptr
|
cdef RpcSystem * thisptr
|
||||||
@@ -2171,6 +2170,16 @@ cdef class _MessageBuilder:
|
|||||||
s = schema
|
s = schema
|
||||||
return _DynamicStructBuilder()._init(self.thisptr.getRootDynamicStruct(s.thisptr), self, True)
|
return _DynamicStructBuilder()._init(self.thisptr.getRootDynamicStruct(s.thisptr), self, True)
|
||||||
|
|
||||||
|
cpdef get_root_as_any(self) except +reraise_kj_exception:
|
||||||
|
"""A method for getting a Cap'n Proto AnyPointer, from an already pre-written buffer
|
||||||
|
|
||||||
|
Don't use this method unless you know what you're doing.
|
||||||
|
|
||||||
|
:rtype: :class:`_DynamicObjectBuilder`
|
||||||
|
:return: An AnyPointer that you can set fields in
|
||||||
|
"""
|
||||||
|
return _DynamicObjectBuilder()._init(self.thisptr.getRootAnyPointer(), self)
|
||||||
|
|
||||||
cpdef set_root(self, value) except +reraise_kj_exception:
|
cpdef set_root(self, value) except +reraise_kj_exception:
|
||||||
"""A method for instantiating Cap'n Proto structs by copying from an existing struct
|
"""A method for instantiating Cap'n Proto structs by copying from an existing struct
|
||||||
|
|
||||||
@@ -2678,10 +2687,6 @@ def add_import_hook(additional_paths=[]):
|
|||||||
if _importer is not None:
|
if _importer is not None:
|
||||||
remove_import_hook()
|
remove_import_hook()
|
||||||
|
|
||||||
this_dir = _os.path.abspath(_os.path.join(_os.path.dirname(__file__), '..'))
|
|
||||||
print this_dir
|
|
||||||
additional_paths.append(this_dir)
|
|
||||||
|
|
||||||
_importer = _Importer(additional_paths)
|
_importer = _Importer(additional_paths)
|
||||||
_sys.meta_path.append(_importer)
|
_sys.meta_path.append(_importer)
|
||||||
|
|
||||||
|
|||||||
1251
capnp/rpc.capnp
1251
capnp/rpc.capnp
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user