Remove many lint warnings
Mostly whitespace changes, with max-line-length set to 120 and double-quotes used, adopting black settings. Related to https://github.com/capnproto/pycapnp/issues/128
This commit is contained in:
@@ -57,4 +57,4 @@ from .lib.capnp import (
|
||||
)
|
||||
|
||||
_init_capnp_api()
|
||||
add_import_hook() # enable import hook by default
|
||||
add_import_hook() # enable import hook by default
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
from capnp.includes.capnp_cpp cimport Maybe, ReaderOptions, DynamicStruct, Request, Response, PyPromise, VoidPromise, PyPromiseArray, RemotePromise, DynamicCapability, InterfaceSchema, EnumSchema, StructSchema, DynamicValue, Capability, RpcSystem, MessageBuilder, MessageReader, TwoPartyVatNetwork, AnyPointer, DynamicStruct_Builder, WaitScope, AsyncIoContext, StringPtr, TaskSet, Timer, AsyncIoStreamReadHelper
|
||||
from capnp.includes.capnp_cpp cimport (
|
||||
Maybe, ReaderOptions, DynamicStruct, Request, Response, PyPromise, VoidPromise, PyPromiseArray,
|
||||
RemotePromise, DynamicCapability, InterfaceSchema, EnumSchema, StructSchema, DynamicValue,
|
||||
Capability, RpcSystem, MessageBuilder, MessageReader, TwoPartyVatNetwork, AnyPointer,
|
||||
DynamicStruct_Builder, WaitScope, AsyncIoContext, StringPtr, TaskSet, Timer, AsyncIoStreamReadHelper,
|
||||
)
|
||||
|
||||
from capnp.includes.schema_cpp cimport ByteArray
|
||||
|
||||
|
||||
@@ -4,8 +4,12 @@ cdef extern from "capnp/helpers/checkCompiler.h":
|
||||
pass
|
||||
|
||||
from libcpp cimport bool
|
||||
from capnp.helpers.non_circular cimport PythonInterfaceDynamicImpl, reraise_kj_exception, PyRefCounter, PyEventPort, ErrorHandler
|
||||
from capnp.includes.schema_cpp cimport Node, Data, StructNode, EnumNode, InterfaceNode, MessageBuilder, MessageReader, ReaderOptions
|
||||
from capnp.helpers.non_circular cimport (
|
||||
PythonInterfaceDynamicImpl, reraise_kj_exception, PyRefCounter, PyEventPort, ErrorHandler,
|
||||
)
|
||||
from capnp.includes.schema_cpp cimport (
|
||||
Node, Data, StructNode, EnumNode, InterfaceNode, MessageBuilder, MessageReader, ReaderOptions,
|
||||
)
|
||||
from capnp.includes.types cimport *
|
||||
|
||||
cdef extern from "capnp/common.h" namespace " ::capnp":
|
||||
@@ -46,8 +50,10 @@ cdef extern from "kj/memory.h" namespace " ::kj":
|
||||
cdef cppclass Own[T]:
|
||||
T& operator*()
|
||||
T* get()
|
||||
Own[TwoPartyVatNetwork] makeTwoPartyVatNetwork" ::kj::heap< ::capnp::TwoPartyVatNetwork>"(AsyncIoStream& stream, Side, ReaderOptions)
|
||||
Own[PromiseFulfillerPair] copyPromiseFulfillerPair" ::kj::heap< ::kj::PromiseFulfillerPair<void> >"(PromiseFulfillerPair&)
|
||||
Own[TwoPartyVatNetwork] makeTwoPartyVatNetwork" ::kj::heap< ::capnp::TwoPartyVatNetwork>"(
|
||||
AsyncIoStream& stream, Side, ReaderOptions)
|
||||
Own[PromiseFulfillerPair] copyPromiseFulfillerPair" ::kj::heap< ::kj::PromiseFulfillerPair<void> >"(
|
||||
PromiseFulfillerPair&)
|
||||
Own[PyRefCounter] makePyRefCounter" ::kj::heap< PyRefCounter >"(PyObject *)
|
||||
|
||||
cdef extern from "kj/async.h" namespace " ::kj":
|
||||
@@ -309,7 +315,8 @@ cdef extern from "capnp/dynamic.h" namespace " ::capnp":
|
||||
DynamicValueForward.Pipeline get(char *)
|
||||
StructSchema getSchema()
|
||||
|
||||
cdef cppclass DynamicStruct_Builder" ::capnp::DynamicStruct::Builder": # Need to flatten this class out, since nested C++ classes cause havoc with cython fused types
|
||||
cdef cppclass DynamicStruct_Builder" ::capnp::DynamicStruct::Builder":
|
||||
# Need to flatten this class out, since nested C++ classes cause havoc with cython fused types
|
||||
DynamicStruct_Builder()
|
||||
DynamicStruct_Builder(DynamicStruct_Builder &)
|
||||
DynamicValueForward.Builder get(char *) except +reraise_kj_exception
|
||||
@@ -344,7 +351,8 @@ cdef extern from "capnp/dynamic.h" namespace " ::capnp":
|
||||
cdef extern from "capnp/capability.h" namespace " ::capnp":
|
||||
cdef cppclass Response" ::capnp::Response< ::capnp::DynamicStruct>"(DynamicStruct.Reader):
|
||||
Response(Response)
|
||||
cdef cppclass RemotePromise" ::capnp::RemotePromise< ::capnp::DynamicStruct>"(Promise[Response], DynamicStruct.Pipeline):
|
||||
cdef cppclass RemotePromise" ::capnp::RemotePromise< ::capnp::DynamicStruct>"(
|
||||
Promise[Response], DynamicStruct.Pipeline):
|
||||
RemotePromise(RemotePromise)
|
||||
cdef cppclass Capability:
|
||||
cppclass Client:
|
||||
@@ -404,20 +412,23 @@ cdef extern from "capnp/any.h" namespace " ::capnp":
|
||||
cdef cppclass AnyPointer:
|
||||
cppclass Reader:
|
||||
DynamicStruct.Reader getAs"getAs< ::capnp::DynamicStruct>"(StructSchema) except +reraise_kj_exception
|
||||
DynamicCapability.Client getAsCapability"getAs< ::capnp::DynamicCapability>"(InterfaceSchema) except +reraise_kj_exception
|
||||
DynamicCapability.Client getAsCapability"getAs< ::capnp::DynamicCapability>"(
|
||||
InterfaceSchema) except +reraise_kj_exception
|
||||
DynamicList.Reader getAsList"getAs< ::capnp::DynamicList>"(ListSchema) except +reraise_kj_exception
|
||||
StringPtr getAsText"getAs< ::capnp::Text>"() except +reraise_kj_exception
|
||||
cppclass Builder:
|
||||
Builder(Builder)
|
||||
DynamicStruct_Builder getAs"getAs< ::capnp::DynamicStruct>"(StructSchema) except +reraise_kj_exception
|
||||
DynamicCapability.Client getAsCapability"getAs< ::capnp::DynamicCapability>"(InterfaceSchema) except +reraise_kj_exception
|
||||
DynamicCapability.Client getAsCapability"getAs< ::capnp::DynamicCapability>"(
|
||||
InterfaceSchema) except +reraise_kj_exception
|
||||
DynamicList.Builder getAsList"getAs< ::capnp::DynamicList>"(ListSchema) except +reraise_kj_exception
|
||||
StringPtr getAsText"getAs< ::capnp::Text>"() except +reraise_kj_exception
|
||||
void setAsStruct"setAs< ::capnp::DynamicStruct>"(DynamicStruct.Reader&) except +reraise_kj_exception
|
||||
void setAsText"setAs< ::capnp::Text>"(char*) except +reraise_kj_exception
|
||||
AnyPointer.Reader asReader() except +reraise_kj_exception
|
||||
void set(AnyPointer.Reader) except +reraise_kj_exception
|
||||
DynamicStruct_Builder initAsStruct"initAs< ::capnp::DynamicStruct>"(StructSchema) except +reraise_kj_exception
|
||||
DynamicStruct_Builder initAsStruct"initAs< ::capnp::DynamicStruct>"(
|
||||
StructSchema) except +reraise_kj_exception
|
||||
DynamicList.Builder initAsList"initAs< ::capnp::DynamicList>"(ListSchema, uint) except +reraise_kj_exception
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ cdef extern from "capnp/message.h" namespace " ::capnp":
|
||||
uint size()
|
||||
|
||||
cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
enum :
|
||||
enum:
|
||||
_ElementSize_inlineComposite " ::capnp::schema::ElementSize::INLINE_COMPOSITE"
|
||||
_ElementSize_eightBytes " ::capnp::schema::ElementSize::EIGHT_BYTES"
|
||||
_ElementSize_pointer " ::capnp::schema::ElementSize::POINTER"
|
||||
@@ -133,7 +133,6 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
cdef cppclass Annotation
|
||||
cdef cppclass CodeGeneratorRequest:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
List[CodeGeneratorRequest.Node].Reader getNodes()
|
||||
@@ -144,17 +143,15 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
List[CodeGeneratorRequest.Node].Builder initNodes(int)
|
||||
List[UInt64].Builder getRequestedFiles()
|
||||
List[UInt64].Builder initRequestedFiles(int)
|
||||
|
||||
cdef cppclass InterfaceNode:
|
||||
cppclass Method
|
||||
|
||||
|
||||
cppclass Method:
|
||||
cppclass Param
|
||||
|
||||
|
||||
cppclass Param:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
Value getDefaultValue()
|
||||
@@ -171,6 +168,7 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setName(Text)
|
||||
List[InterfaceNode.Method.Param.Annotation].Builder getAnnotations()
|
||||
List[InterfaceNode.Method.Param.Annotation].Builder initAnnotations(int)
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
UInt16 getCodeOrder()
|
||||
@@ -179,6 +177,7 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
UInt16 getRequiredParamCount()
|
||||
Type getReturnType()
|
||||
List[InterfaceNode.Method.Annotation].Reader getAnnotations()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
UInt16 getCodeOrder()
|
||||
@@ -193,20 +192,21 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setReturnType(Type)
|
||||
List[InterfaceNode.Method.Annotation].Builder getAnnotations()
|
||||
List[InterfaceNode.Method.Annotation].Builder initAnnotations(int)
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
List[InterfaceNode.InterfaceNode.Method].Reader getMethods()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
List[InterfaceNode.InterfaceNode.Method].Builder getMethods()
|
||||
List[InterfaceNode.InterfaceNode.Method].Builder initMethods(int)
|
||||
|
||||
cdef cppclass Value:
|
||||
cppclass Body
|
||||
|
||||
|
||||
cppclass Body:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
int which()
|
||||
UInt32 getUint32Value()
|
||||
@@ -228,6 +228,7 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
Text.Reader getTextValue()
|
||||
UInt64 getUint64Value()
|
||||
Object getObjectValue()
|
||||
|
||||
cppclass Builder:
|
||||
int which()
|
||||
UInt32 getUint32Value()
|
||||
@@ -268,33 +269,35 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setUint64Value(UInt64)
|
||||
Object getObjectValue()
|
||||
void setObjectValue(Object)
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
Value.Body getBody()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
Value.Body getBody()
|
||||
void setBody(Value.Body)
|
||||
cdef cppclass ConstNode:
|
||||
|
||||
cdef cppclass ConstNode:
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
Type getType()
|
||||
Value getValue()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
Type getType()
|
||||
void setType(Type)
|
||||
Value getValue()
|
||||
void setValue(Value)
|
||||
|
||||
cdef cppclass Type:
|
||||
cppclass Body
|
||||
|
||||
|
||||
cppclass Body:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
int which()
|
||||
Void getBoolType()
|
||||
@@ -316,6 +319,7 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
Void getUint64Type()
|
||||
Void getTextType()
|
||||
Void getInt16Type()
|
||||
|
||||
cppclass Builder:
|
||||
int which()
|
||||
Void getBoolType()
|
||||
@@ -356,45 +360,48 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setTextType(Void)
|
||||
Void getInt16Type()
|
||||
void setInt16Type(Void)
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
Type.Body getBody()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
Type.Body getBody()
|
||||
void setBody(Type.Body)
|
||||
|
||||
cdef cppclass FileNode:
|
||||
cppclass Import
|
||||
|
||||
|
||||
cppclass Import:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
UInt64 getId()
|
||||
Text.Reader getName()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
UInt64 getId()
|
||||
void setId(UInt64)
|
||||
Text.Builder getName()
|
||||
void setName(Text)
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
List[FileNode.FileNode.Import].Reader getImports()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
List[FileNode.FileNode.Import].Builder getImports()
|
||||
List[FileNode.FileNode.Import].Builder initImports(int)
|
||||
|
||||
cdef cppclass Node:
|
||||
cppclass Body
|
||||
cppclass NestedNode
|
||||
|
||||
|
||||
cppclass Body:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
int which()
|
||||
AnnotationNode getAnnotationNode()
|
||||
@@ -417,8 +424,8 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setConstNode(ConstNode)
|
||||
FileNode getFileNode()
|
||||
void setFileNode(FileNode)
|
||||
cppclass NestedNode:
|
||||
|
||||
cppclass NestedNode:
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
@@ -444,6 +451,7 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
bint isInterface()
|
||||
bint isConst()
|
||||
bint isAnnotation()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
Node.Body getBody()
|
||||
@@ -464,8 +472,8 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
bint isInterface()
|
||||
bint isConst()
|
||||
bint isAnnotation()
|
||||
cdef cppclass AnnotationNode:
|
||||
|
||||
cdef cppclass AnnotationNode:
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
@@ -481,6 +489,7 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
Bool getTargetsEnum()
|
||||
Bool getTargetsInterface()
|
||||
Bool getTargetsMethod()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
Bool getTargetsField()
|
||||
@@ -507,18 +516,18 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setTargetsInterface(Bool)
|
||||
Bool getTargetsMethod()
|
||||
void setTargetsMethod(Bool)
|
||||
|
||||
cdef cppclass EnumNode:
|
||||
cppclass Enumerant
|
||||
|
||||
|
||||
cppclass Enumerant:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
UInt16 getCodeOrder()
|
||||
Text.Reader getName()
|
||||
List[EnumNode.Enumerant.Annotation].Reader getAnnotations()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
UInt16 getCodeOrder()
|
||||
@@ -527,22 +536,23 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setName(Text)
|
||||
List[EnumNode.Enumerant.Annotation].Builder getAnnotations()
|
||||
List[EnumNode.Enumerant.Annotation].Builder initAnnotations(int)
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
List[EnumNode.EnumNode.Enumerant].Reader getEnumerants()
|
||||
|
||||
cppclass Builder:
|
||||
|
||||
List[EnumNode.EnumNode.Enumerant].Builder getEnumerants()
|
||||
List[EnumNode.EnumNode.Enumerant].Builder initEnumerants(int)
|
||||
|
||||
cdef cppclass StructNode:
|
||||
cppclass Union
|
||||
cppclass Member
|
||||
cppclass Field
|
||||
|
||||
|
||||
cppclass Union:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
UInt32 getDiscriminantOffset()
|
||||
@@ -556,10 +566,8 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
cppclass Member:
|
||||
cppclass Body
|
||||
|
||||
|
||||
cppclass Body:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
int which()
|
||||
Field getFieldMember()
|
||||
@@ -589,8 +597,8 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setName(Text)
|
||||
List[StructNode.Member.Annotation].Builder getAnnotations()
|
||||
List[StructNode.Member.Annotation].Builder initAnnotations(int)
|
||||
cppclass Field:
|
||||
|
||||
cppclass Field:
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
@@ -620,7 +628,6 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
void setPointerSectionSize(UInt16)
|
||||
cdef cppclass Annotation:
|
||||
|
||||
|
||||
cppclass Reader:
|
||||
|
||||
UInt64 getId()
|
||||
@@ -632,10 +639,10 @@ cdef extern from "capnp/schema.capnp.h" namespace " ::capnp::schema":
|
||||
Value getValue()
|
||||
void setValue(Value)
|
||||
cdef cppclass ListNestedNodeReader"capnp::List<capnp::schema::Node::NestedNode>::Reader":
|
||||
ListNestedNodeReader()
|
||||
ListNestedNodeReader(ListNestedNodeReader)
|
||||
Node.NestedNode.Reader operator[](uint)
|
||||
uint size()
|
||||
ListNestedNodeReader()
|
||||
ListNestedNodeReader(ListNestedNodeReader)
|
||||
Node.NestedNode.Reader operator[](uint)
|
||||
uint size()
|
||||
|
||||
cdef extern from "capnp/message.h" namespace " ::capnp":
|
||||
cdef cppclass ReaderOptions:
|
||||
|
||||
@@ -15,4 +15,4 @@ ctypedef char * Object
|
||||
ctypedef bint Bool
|
||||
ctypedef float Float32
|
||||
ctypedef double Float64
|
||||
from libcpp cimport bool as cbool
|
||||
from libcpp cimport bool as cbool
|
||||
|
||||
@@ -2,7 +2,18 @@
|
||||
|
||||
from capnp.includes cimport capnp_cpp as capnp
|
||||
from capnp.includes cimport schema_cpp
|
||||
from capnp.includes.capnp_cpp cimport Schema as C_Schema, StructSchema as C_StructSchema, InterfaceSchema as C_InterfaceSchema, EnumSchema as C_EnumSchema, ListSchema as C_ListSchema, DynamicStruct as C_DynamicStruct, DynamicValue as C_DynamicValue, Type as C_Type, DynamicList as C_DynamicList, SchemaParser as C_SchemaParser, ParsedSchema as C_ParsedSchema, VOID, ArrayPtr, StringPtr, String, StringTree, DynamicOrphan as C_DynamicOrphan, AnyPointer as C_DynamicObject, DynamicCapability as C_DynamicCapability, Request, Response, RemotePromise, Promise, CallContext, RpcSystem, makeRpcServerBootstrap, makeRpcClient, Capability as C_Capability, TwoPartyVatNetwork as C_TwoPartyVatNetwork, Side, AsyncIoStream, Own, makeTwoPartyVatNetwork, PromiseFulfillerPair as C_PromiseFulfillerPair, copyPromiseFulfillerPair, newPromiseAndFulfiller, PyArray, DynamicStruct_Builder, TwoWayPipe
|
||||
from capnp.includes.capnp_cpp cimport (
|
||||
Schema as C_Schema, StructSchema as C_StructSchema, InterfaceSchema as C_InterfaceSchema,
|
||||
EnumSchema as C_EnumSchema, ListSchema as C_ListSchema, DynamicStruct as C_DynamicStruct,
|
||||
DynamicValue as C_DynamicValue, Type as C_Type, DynamicList as C_DynamicList,
|
||||
SchemaParser as C_SchemaParser, ParsedSchema as C_ParsedSchema, VOID, ArrayPtr, StringPtr,
|
||||
String, StringTree, DynamicOrphan as C_DynamicOrphan, AnyPointer as C_DynamicObject,
|
||||
DynamicCapability as C_DynamicCapability, Request, Response, RemotePromise, Promise,
|
||||
CallContext, RpcSystem, makeRpcServerBootstrap, makeRpcClient, Capability as C_Capability,
|
||||
TwoPartyVatNetwork as C_TwoPartyVatNetwork, Side, AsyncIoStream, Own, makeTwoPartyVatNetwork,
|
||||
PromiseFulfillerPair as C_PromiseFulfillerPair, copyPromiseFulfillerPair, newPromiseAndFulfiller,
|
||||
PyArray, DynamicStruct_Builder, TwoWayPipe,
|
||||
)
|
||||
from capnp.includes.schema_cpp cimport Node as C_Node, EnumNode as C_EnumNode
|
||||
from capnp.includes.types cimport *
|
||||
from capnp.helpers.non_circular cimport reraise_kj_exception
|
||||
@@ -149,7 +160,8 @@ cdef _setDynamicFieldStatic(DynamicStruct_Builder thisptr, field, value, parent)
|
||||
|
||||
cdef api object wrap_dynamic_struct_reader(Response & r) with gil
|
||||
cdef api PyObject * wrap_remote_call(PyObject * func, Response & r) except * with gil
|
||||
cdef api Promise[void] * call_server_method(PyObject * _server, char * _method_name, CallContext & _context) except * with gil
|
||||
cdef api Promise[void] * call_server_method(
|
||||
PyObject * _server, char * _method_name, CallContext & _context) except * with gil
|
||||
cdef api convert_array_pyobject(PyArray & arr) with gil
|
||||
cdef api Promise[PyObject*] * extract_promise(object obj) with gil
|
||||
cdef api RemotePromise * extract_remote_promise(object obj) with gil
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user