コード例 #1
0
ファイル: foo_static.py プロジェクト: trafi/djinni
 def update_static_messg_to(static_string):
     with CPyString.fromPy(static_string) as pys_static_string:
         _ret_c = lib.cw__foo_static_update_static_messg_to(pys_static_string.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #2
0
ファイル: foo_listener_bf.py プロジェクト: ubook-editora/finn
 def on_string_change(self, private_string):
     with CPyString.fromPy(private_string) as pys_private_string:
         _ret_c = lib.cw__foo_listener_bf_on_string_change(self._cpp_impl, pys_private_string.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #3
0
ファイル: foo_listener_bf.py プロジェクト: trafi/djinni
 def on_string_change(self, private_string):
     with CPyString.fromPy(private_string) as pys_private_string:
         _ret_c = lib.cw__foo_listener_bf_on_string_change(self._cpp_impl, pys_private_string.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #4
0
 def __get_value(cself, key):
     pyKey = CPyString.toPyWithoutTakingOwnership(key)
     try:
         with CPyString.fromPyOpt(CPyObjectProxy.toPyObj(None, cself)[pyKey]) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #5
0
ファイル: foo_receiver.py プロジェクト: trafi/djinni
 def cause_changes_string_optional_returned(self, i, f, s, binar, b, d):
     with CPyBoxedI32.fromPyOpt(i) as pyopt_i,\
             CPyString.fromPyOpt(s) as pyopt_s,\
             CPyBinary.fromPy(binar) as pybin_binar:
         _ret_c = lib.cw__foo_receiver_cause_changes_string_optional_returned(self._cpp_impl, pyopt_i.release_djinni_boxed(), CPyPrimitive.fromPy(f), pyopt_s.release_djinni_string(), pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b), CPyDate.fromPy(d))
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPyOpt(_ret_c)
         return _ret
コード例 #6
0
ファイル: foo_static.py プロジェクト: ubook-editora/finn
 def update_static_messg_to(static_string):
     with CPyString.fromPy(static_string) as pys_static_string:
         _ret_c = lib.cw__foo_static_update_static_messg_to(
             pys_static_string.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #7
0
ファイル: foo_interface.py プロジェクト: trafi/djinni
 def get_set_strings(self, ps1, ps2):
     with CPyString.fromPy(ps1) as pys_ps1,\
             CPyString.fromPy(ps2) as pys_ps2:
         _ret_c = lib.cw__foo_interface_get_set_strings(self._cpp_impl, pys_ps1.release_djinni_string(), pys_ps2.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #8
0
ファイル: foo_receiver.py プロジェクト: trafi/djinni
 def cause_changes_string_returned(self, i, f, s, binar, b, d):
     with CPyString.fromPy(s) as pys_s,\
             CPyBinary.fromPy(binar) as pybin_binar:
         _ret_c = lib.cw__foo_receiver_cause_changes_string_returned(self._cpp_impl, CPyPrimitive.fromPy(i), CPyPrimitive.fromPy(f), pys_s.release_djinni_string(), pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b), CPyDate.fromPy(d))
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #9
0
 def __get_value(cself, key):
     pyKey = CPyString.toPyWithoutTakingOwnership(key)
     try:
         with CPyString.fromPyOpt(
                 CPyObjectProxy.toPyObj(None, cself)[pyKey]) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #10
0
 def on_string_change(cself, private_string):
     try:
         with CPyString.fromPy(FooListenerHelper.selfToPy(cself).on_string_change(CPyString.toPy(private_string))) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #11
0
 def get_set_strings(self, ps1, ps2):
     with CPyString.fromPy(ps1) as pys_ps1,\
             CPyString.fromPy(ps2) as pys_ps2:
         _ret_c = lib.cw__foo_interface_get_set_strings(
             self._cpp_impl, pys_ps1.release_djinni_string(),
             pys_ps2.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #12
0
ファイル: dh__map_string_string.py プロジェクト: trafi/djinni
 def __get_value(cself, key):
     pyKey = CPyString.toPyWithoutTakingOwnership(key)
     assert pyKey is not None
     try:
         with CPyString.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey]) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #13
0
 def __get_value(cself, key):
     pyKey = CPyString.toPyWithoutTakingOwnership(key)
     assert pyKey is not None
     try:
         with CPyString.fromPy(CPyObjectProxy.toPyObj(
                 None, cself)[pyKey]) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #14
0
 def cause_changes_string_optional_returned(self, i, f, s, binar, b, d):
     with CPyBoxedI32.fromPyOpt(i) as pyopt_i,\
             CPyString.fromPyOpt(s) as pyopt_s,\
             CPyBinary.fromPy(binar) as pybin_binar:
         _ret_c = lib.cw__foo_receiver_cause_changes_string_optional_returned(
             self._cpp_impl, pyopt_i.release_djinni_boxed(),
             CPyPrimitive.fromPy(f), pyopt_s.release_djinni_string(),
             pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b),
             CPyDate.fromPy(d))
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPyOpt(_ret_c)
         return _ret
コード例 #15
0
 def get_record(cself, record_id, utf8string, misc):
     try:
         _ret = CPyRecord.fromPy(
             ClientReturnedRecord.c_data_set,
             ClientInterfaceHelper.selfToPy(cself).get_record(
                 CPyPrimitive.toPy(record_id), CPyString.toPy(utf8string),
                 CPyString.toPyOpt(misc)))
         assert _ret != ffi.NULL
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #16
0
 def cause_changes_string_returned(self, i, f, s, binar, b, d):
     with CPyString.fromPy(s) as pys_s,\
             CPyBinary.fromPy(binar) as pybin_binar:
         _ret_c = lib.cw__foo_receiver_cause_changes_string_returned(
             self._cpp_impl, CPyPrimitive.fromPy(i), CPyPrimitive.fromPy(f),
             pys_s.release_djinni_string(),
             pybin_binar.release_djinni_binary(), CPyPrimitive.fromPy(b),
             CPyDate.fromPy(d))
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyString.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #17
0
 def python_create_foo_client_returned_record(record_id, content,
                                              some_record):
     py_rec = FooClientReturnedRecord(
         CPyPrimitive.toPy(record_id), CPyString.toPy(content),
         CPyRecord.toPy(FooSomeOtherRecord.c_data_set, some_record))
     return CPyRecord.fromPy(FooClientReturnedRecord.c_data_set,
                             py_rec)  #to do: can be optional?
コード例 #18
0
 def get_client_returned_record_f3(cself):
     try:
         with CPyString.fromPyOpt(CPyRecord.toPy(None, cself).misc) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #19
0
 def python_create_my_record(id, info, store, hash):
     py_rec = MyRecord(
         CPyPrimitive.toPy(id), CPyString.toPy(info),
         CPyObjectProxy.toPyObj(SetStringHelper.c_data_set, store),
         CPyObjectProxy.toPyObj(MapStringInt32THelper.c_data_set, hash))
     return CPyRecord.fromPy(MyRecord.c_data_set,
                             py_rec)  #to do: can be optional?
コード例 #20
0
 def python_create_foo_client_returned_record(record_id, content, some_record):
     py_rec = FooClientReturnedRecord(
         CPyPrimitive.toPy(record_id),
         CPyString.toPy(content),
         CPyRecord.toPy(FooSomeOtherRecord.c_data_set, some_record),
     )
     return CPyRecord.fromPy(FooClientReturnedRecord.c_data_set, py_rec)  # to do: can be optional?
コード例 #21
0
 def meth_taking_optional_interface(self, i):
     _ret_c = lib.cw__reverse_client_interface_meth_taking_optional_interface(
         self._cpp_impl, ReverseClientInterfaceHelper.fromPy(i))
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyString.toPy(_ret_c)
     assert _ret is not None
     return _ret
コード例 #22
0
 def on_changes_string_optional_returned(cself, i, f, s, binar, b, d):
     try:
         with CPyString.fromPyOpt(FooListenerHelper.selfToPy(cself).on_changes_string_optional_returned(CPyBoxedI32.toPyOpt(i), CPyPrimitive.toPy(f), CPyString.toPyOpt(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d))) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #23
0
 def __python_next(cself):
     try:
         with CPyString.fromPyOpt(next(CPyObjectProxy.toPyIter(cself))) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #24
0
 def method_returning_some_type(self, key):
     with CPyString.fromPy(key) as pys_key:
         _ret_c = lib.cw__my_cpp_interface_method_returning_some_type(
             self._cpp_impl, pys_key.release_djinni_string())
         CPyException.toPyCheckAndRaise(_ret_c)
         _ret = CPyPrimitive.toPy(_ret_c)
         assert _ret is not None
         return _ret
コード例 #25
0
 def get_client_returned_record_f3(cself):
     try:
         with CPyString.fromPyOpt(CPyRecord.toPy(None,
                                                 cself).misc) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #26
0
 def get_my_record_f5(cself):
     try:
         with CPyString.fromPyOpt(CPyRecord.toPy(None,
                                                 cself).test3_1) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #27
0
 def __python_next(cself):
     try:
         with CPyString.fromPyOpt(next(
                 CPyObjectProxy.toPyIter(cself))) as py_obj:
             return py_obj.release_djinni_string()
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #28
0
 def __get_value(cself, key):
     pyKey = CPyString.toPyWithoutTakingOwnership(key)
     assert pyKey is not None
     try:
         _ret = CPyPrimitive.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey])
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #29
0
 def get_record_with_derivings_f2(cself):
     try:
         with CPyString.fromPy(CPyRecord.toPy(None, cself).key2) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #30
0
ファイル: foo_listener_bf.py プロジェクト: ubook-editora/finn
 def get_string(cself):
     try:
         with CPyString.fromPy(FooListenerBfHelper.selfToPy(cself).get_string()) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #31
0
ファイル: foo_listener_bf.py プロジェクト: trafi/djinni
 def get_string(cself):
     try:
         with CPyString.fromPy(FooListenerBfHelper.selfToPy(cself).get_string()) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #32
0
 def __get_value(cself, key):
     pyKey = CPyString.toPyWithoutTakingOwnership(key)
     assert pyKey is not None
     try:
         _ret = CPyPrimitive.fromPy(CPyObjectProxy.toPyObj(None, cself)[pyKey])
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #33
0
ファイル: dh__list_string.py プロジェクト: trafi/djinni
 def __get_elem(cself, index):
     try:
         with CPyString.fromPy(CPyObject.toPy(None, cself)[index]) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #34
0
 def get_my_record_f4(cself):
     try:
         with CPyString.fromPy(CPyRecord.toPy(None, cself).test3) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #35
0
ファイル: foo_constants_helper.py プロジェクト: trafi/djinni
 def get_foo_constants_f2(cself):
     try:
         with CPyString.fromPy(CPyRecord.toPy(None, cself).some_string) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #36
0
 def __get_elem(cself, index):
     try:
         with CPyString.fromPy(CPyObject.toPy(None, cself)[index]) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #37
0
 def get_foo_constants_f2(cself):
     try:
         with CPyString.fromPy(CPyRecord.toPy(None,
                                              cself).some_string) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #38
0
 def get_custom_datatype_f1(cself):
     try:
         with CPyString.fromPy(CPyRecord.toPy(None,
                                              cself).recordData) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #39
0
 def __next(cself):
     try:
         with CPyString.fromPy(next(
                 CPyObjectProxy.toPyIter(cself))) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #40
0
 def return_str(cself):
     try:
         with CPyString.fromPy(
                 ClientInterfaceHelper.selfToPy(
                     cself).return_str()) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #41
0
 def python_create_record_with_derivings(eight,sixteen,thirtytwo,sixtyfour,fthirtytwo,fsixtyfour,d,s):
     py_rec = RecordWithDerivings(
         CPyPrimitive.toPy(eight),
         CPyPrimitive.toPy(sixteen),
         CPyPrimitive.toPy(thirtytwo),
         CPyPrimitive.toPy(sixtyfour),
         CPyPrimitive.toPy(fthirtytwo),
         CPyPrimitive.toPy(fsixtyfour),
         CPyDate.toPy(d),
         CPyString.toPy(s))
     return CPyRecord.fromPy(RecordWithDerivings.c_data_set, py_rec) #to do: can be optional?
コード例 #42
0
 def meth_taking_optional_interface(cself, i):
     try:
         with CPyString.fromPy(
                 ClientInterfaceHelper.selfToPy(
                     cself).meth_taking_optional_interface(
                         ClientInterfaceHelper.toPy(i))) as py_obj:
             _ret = py_obj.release_djinni_string()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #43
0
 def python_create_my_record(test, test1, test2, test3, test3_1, test4,
                             test4_1, test5, test6, test7, test8, test9,
                             test10, test10_1, test11, test13, test14,
                             test15, test16, test17):
     py_rec = MyRecord(
         CPyPrimitive.toPy(test), CPyBoxedU32.toPyOpt(test1),
         CPyObject.toPy(ListUint32THelper.c_data_set, test2),
         CPyString.toPy(test3), CPyString.toPyOpt(test3_1),
         CPyDate.toPy(test4), CPyBoxedDate.toPyOpt(test4_1),
         CPyBinary.toPy(test5),
         CPyObject.toPy(ListBinaryHelper.c_data_set, test6),
         CPyObjectProxy.toPyObj(SetInt32THelper.c_data_set, test7),
         CPyObjectProxy.toPyObj(MapInt32TStringHelper.c_data_set, test8),
         CPyRecord.toPy(Rc.c_data_set, test9),
         CPyRecord.toPyOpt(Rc.c_data_set, test10),
         CPyObject.toPy(ListRecordRcHelper.c_data_set, test10_1),
         CPyEnum.toPy(MyEnum, test11), CPyEnum.toPyOpt(MyEnum, test13),
         CPyBoxedI16.toPyOpt(test14),
         CPyObject.toPy(ListEnumMyEnumHelper.c_data_set, test15),
         CPyObjectProxy.toPyObj(SetEnumMyEnumHelper.c_data_set, test16),
         CPyObjectProxy.toPyObj(MapEnumMyEnumInt16THelper.c_data_set,
                                test17))
     return CPyRecord.fromPy(MyRecord.c_data_set,
                             py_rec)  #to do: can be optional?
コード例 #44
0
 def python_create_all_datatypes(booleanData, integer8Data, integer16Data,
                                 integer32Data, integer64Data, float32Data,
                                 float64Data, stringData, binaryData,
                                 dateData, listData, setData, mapData,
                                 optionalData):
     py_rec = AllDatatypes(
         CPyPrimitive.toPy(booleanData), CPyPrimitive.toPy(integer8Data),
         CPyPrimitive.toPy(integer16Data), CPyPrimitive.toPy(integer32Data),
         CPyPrimitive.toPy(integer64Data), CPyPrimitive.toPy(float32Data),
         CPyPrimitive.toPy(float64Data), CPyString.toPy(stringData),
         CPyBinary.toPy(binaryData), CPyDate.toPy(dateData),
         CPyObject.toPy(ListBoolHelper.c_data_set, listData),
         CPyObjectProxy.toPyObj(SetBoolHelper.c_data_set, setData),
         CPyObjectProxy.toPyObj(MapInt8TBoolHelper.c_data_set, mapData),
         CPyBoxedBool.toPyOpt(optionalData))
     return CPyRecord.fromPy(AllDatatypes.c_data_set,
                             py_rec)  #to do: can be optional?
コード例 #45
0
ファイル: foo_primitives.py プロジェクト: trafi/djinni
 def get_string(self):
     _ret_c = lib.cw__foo_primitives_get_string(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyString.toPy(_ret_c)
     assert _ret is not None
     return _ret
コード例 #46
0
ファイル: foo_primitives.py プロジェクト: trafi/djinni
 def set_string(self, private_string):
     with CPyString.fromPy(private_string) as pys_private_string:
         lib.cw__foo_primitives_set_string(self._cpp_impl, pys_private_string.release_djinni_string())
         CPyException.toPyCheckAndRaise(ffi.NULL)
コード例 #47
0
ファイル: foo_client_interface.py プロジェクト: trafi/djinni
 def get_extensible_record_string2(self):
     _ret_c = lib.cw__foo_client_interface_get_extensible_record_string2(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyString.toPy(_ret_c)
     assert _ret is not None
     return _ret
コード例 #48
0
ファイル: foo_listener.py プロジェクト: trafi/djinni
 def on_changes_int_returned(cself, i, f, s, binar, b, d):
     try:
         _ret = CPyPrimitive.fromPy(FooListenerHelper.selfToPy(cself).on_changes_int_returned(CPyPrimitive.toPy(i), CPyPrimitive.toPy(f), CPyString.toPy(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d)))
         return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL
コード例 #49
0
ファイル: test_helpers.py プロジェクト: trafi/djinni
 def check_token_type(t, type):
     with CPyString.fromPy(type) as pys_type:
         lib.cw__test_helpers_check_token_type(UserTokenHelper.fromPy(t), pys_type.release_djinni_string())
         CPyException.toPyCheckAndRaise(ffi.NULL)
コード例 #50
0
ファイル: foo_constants_helper.py プロジェクト: trafi/djinni
 def python_create_foo_constants(some_integer,some_string):
     py_rec = FooConstants(
         CPyPrimitive.toPy(some_integer),
         CPyString.toPy(some_string))
     return CPyRecord.fromPy(FooConstants.c_data_set, py_rec) #to do: can be optional?
コード例 #51
0
 def python_create_client_returned_record(record_id,content,misc):
     py_rec = ClientReturnedRecord(
         CPyPrimitive.toPy(record_id),
         CPyString.toPy(content),
         CPyString.toPyOpt(misc))
     return CPyRecord.fromPy(ClientReturnedRecord.c_data_set, py_rec) #to do: can be optional?
コード例 #52
0
 def python_create_record_with_derivings(key1,key2):
     py_rec = RecordWithDerivings(
         CPyPrimitive.toPy(key1),
         CPyString.toPy(key2))
     return CPyRecord.fromPy(RecordWithDerivings.c_data_set, py_rec) #to do: can be optional?
コード例 #53
0
ファイル: dh__map_string_string.py プロジェクト: trafi/djinni
 def __python_add(cself, key, value):
     CPyObjectProxy.toPyObj(None, cself)[CPyString.toPy(key)] = CPyString.toPy(value)
コード例 #54
0
ファイル: exception.py プロジェクト: trafi/djinni
 def create_py_from_cpp_exception(ds_error_message):
     e = DjinniException(CPyString.toPy(ds_error_message))
     c_ptr = ffi.new_handle(e)
     ExceptionHelper.c_data_set.add(c_ptr)
     return c_ptr
コード例 #55
0
ファイル: foo_listener.py プロジェクト: trafi/djinni
 def cause_py_exception(cself, exception_arg):
     try:
         FooListenerHelper.selfToPy(cself).cause_py_exception(CPyString.toPy(exception_arg))
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
コード例 #56
0
 def get_private_string(self):
     _ret_c = lib.cw__foo_interface_get_private_string(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyString.toPy(_ret_c)
     assert _ret is not None
     return _ret
コード例 #57
0
ファイル: user_token.py プロジェクト: trafi/djinni
 def whoami(self):
     _ret_c = lib.cw__user_token_whoami(self._cpp_impl)
     CPyException.toPyCheckAndRaise(_ret_c)
     _ret = CPyString.toPy(_ret_c)
     assert _ret is not None
     return _ret
コード例 #58
0
ファイル: foo_listener.py プロジェクト: trafi/djinni
 def on_changes_binary_returned(cself, i, f, s, binar, b, d):
     try:
         with CPyBinary.fromPy(FooListenerHelper.selfToPy(cself).on_changes_binary_returned(CPyPrimitive.toPy(i), CPyPrimitive.toPy(f), CPyString.toPy(s), CPyBinary.toPy(binar), CPyPrimitive.toPy(b), CPyDate.toPy(d))) as py_obj:
             _ret = py_obj.release_djinni_binary()
             assert _ret != ffi.NULL
             return _ret
     except Exception as _djinni_py_e:
         CPyException.setExceptionFromPy(_djinni_py_e)
         return ffi.NULL