objective-lol 0.0.1__cp313-cp313-win_amd64.whl → 0.0.2__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- objective_lol/_api.cp313-win_amd64.h +94 -94
- objective_lol/_api.cp313-win_amd64.pyd +0 -0
- objective_lol/api.c +1003 -1003
- objective_lol/api.go +719 -719
- objective_lol/api.py +542 -542
- objective_lol/api_go.h +94 -94
- objective_lol/build.py +77 -77
- objective_lol/go.py +1 -1
- {objective_lol-0.0.1.dist-info → objective_lol-0.0.2.dist-info}/METADATA +17 -1
- objective_lol-0.0.2.dist-info/RECORD +14 -0
- objective_lol-0.0.1.dist-info/RECORD +0 -14
- {objective_lol-0.0.1.dist-info → objective_lol-0.0.2.dist-info}/WHEEL +0 -0
- {objective_lol-0.0.1.dist-info → objective_lol-0.0.2.dist-info}/top_level.txt +0 -0
objective_lol/api.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# python wrapper for package github.com/bjia56/objective-lol/pkg/api within overall package api
|
3
3
|
# This is what you import to use the package.
|
4
4
|
# File is generated by gopy. Do not edit.
|
5
|
-
# gopy.exe build -no-make -dynamic-link=True -symbols=False -output D:\a\objective-lol\objective-lol\python\build\lib.win-amd64-cpython-313\objective_lol --vm D:\a\objective-lol\objective-lol\python\.toolchain\python\python-3.13.
|
5
|
+
# gopy.exe build -no-make -dynamic-link=True -symbols=False -output D:\a\objective-lol\objective-lol\python\build\lib.win-amd64-cpython-313\objective_lol --vm D:\a\objective-lol\objective-lol\python\.toolchain\python\python-3.13.7\bin\python.exe .
|
6
6
|
|
7
7
|
# the following is required to enable dlopen to open the _go.so file
|
8
8
|
import os,sys,inspect,collections
|
@@ -741,8 +741,8 @@ TimeoutErrorType = "timeout"
|
|
741
741
|
|
742
742
|
# ---- Structs ---
|
743
743
|
|
744
|
-
# Python type for struct api.
|
745
|
-
class
|
744
|
+
# Python type for struct api.UnknownFunctionHandler
|
745
|
+
class UnknownFunctionHandler(go.GoClass):
|
746
746
|
""""""
|
747
747
|
def __init__(self, *args, **kwargs):
|
748
748
|
"""
|
@@ -757,21 +757,13 @@ class ClassMethod(go.GoClass):
|
|
757
757
|
self.handle = args[0].handle
|
758
758
|
_api.IncRef(self.handle)
|
759
759
|
else:
|
760
|
-
self.handle = _api.
|
760
|
+
self.handle = _api.api_UnknownFunctionHandler_CTor()
|
761
761
|
_api.IncRef(self.handle)
|
762
|
-
if 0 < len(args):
|
763
|
-
self.Name = args[0]
|
764
|
-
if "Name" in kwargs:
|
765
|
-
self.Name = kwargs["Name"]
|
766
|
-
if 1 < len(args):
|
767
|
-
self.Argc = args[1]
|
768
|
-
if "Argc" in kwargs:
|
769
|
-
self.Argc = kwargs["Argc"]
|
770
762
|
def __del__(self):
|
771
763
|
_api.DecRef(self.handle)
|
772
764
|
def __str__(self):
|
773
765
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
774
|
-
sv = 'api.
|
766
|
+
sv = 'api.UnknownFunctionHandler{'
|
775
767
|
first = True
|
776
768
|
for v in pr:
|
777
769
|
if callable(v[1]):
|
@@ -784,33 +776,15 @@ class ClassMethod(go.GoClass):
|
|
784
776
|
return sv + '}'
|
785
777
|
def __repr__(self):
|
786
778
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
787
|
-
sv = 'api.
|
779
|
+
sv = 'api.UnknownFunctionHandler ( '
|
788
780
|
for v in pr:
|
789
781
|
if not callable(v[1]):
|
790
782
|
sv += v[0] + '=' + str(v[1]) + ', '
|
791
783
|
return sv + ')'
|
792
|
-
@property
|
793
|
-
def Name(self):
|
794
|
-
return _api.api_ClassMethod_Name_Get(self.handle)
|
795
|
-
@Name.setter
|
796
|
-
def Name(self, value):
|
797
|
-
if isinstance(value, go.GoClass):
|
798
|
-
_api.api_ClassMethod_Name_Set(self.handle, value.handle)
|
799
|
-
else:
|
800
|
-
_api.api_ClassMethod_Name_Set(self.handle, value)
|
801
|
-
@property
|
802
|
-
def Argc(self):
|
803
|
-
return _api.api_ClassMethod_Argc_Get(self.handle)
|
804
|
-
@Argc.setter
|
805
|
-
def Argc(self, value):
|
806
|
-
if isinstance(value, go.GoClass):
|
807
|
-
_api.api_ClassMethod_Argc_Set(self.handle, value.handle)
|
808
|
-
else:
|
809
|
-
_api.api_ClassMethod_Argc_Set(self.handle, value)
|
810
784
|
|
811
|
-
# Python type for struct api.
|
812
|
-
class
|
813
|
-
"""
|
785
|
+
# Python type for struct api.VMCompatibilityShim
|
786
|
+
class VMCompatibilityShim(go.GoClass):
|
787
|
+
"""VMCompatibilityShim is a shim to provide compatibility for external\nlanguages that cannot interact with the standard VM interface through\nGo types. Message passing is done through JSON strings.\n"""
|
814
788
|
def __init__(self, *args, **kwargs):
|
815
789
|
"""
|
816
790
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
@@ -824,25 +798,13 @@ class ExecutionResult(go.GoClass):
|
|
824
798
|
self.handle = args[0].handle
|
825
799
|
_api.IncRef(self.handle)
|
826
800
|
else:
|
827
|
-
self.handle = _api.
|
801
|
+
self.handle = _api.api_VMCompatibilityShim_CTor()
|
828
802
|
_api.IncRef(self.handle)
|
829
|
-
if 0 < len(args):
|
830
|
-
self.Value = args[0]
|
831
|
-
if "Value" in kwargs:
|
832
|
-
self.Value = kwargs["Value"]
|
833
|
-
if 1 < len(args):
|
834
|
-
self.RawValue = args[1]
|
835
|
-
if "RawValue" in kwargs:
|
836
|
-
self.RawValue = kwargs["RawValue"]
|
837
|
-
if 2 < len(args):
|
838
|
-
self.Output = args[2]
|
839
|
-
if "Output" in kwargs:
|
840
|
-
self.Output = kwargs["Output"]
|
841
803
|
def __del__(self):
|
842
804
|
_api.DecRef(self.handle)
|
843
805
|
def __str__(self):
|
844
806
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
845
|
-
sv = 'api.
|
807
|
+
sv = 'api.VMCompatibilityShim{'
|
846
808
|
first = True
|
847
809
|
for v in pr:
|
848
810
|
if callable(v[1]):
|
@@ -855,48 +817,55 @@ class ExecutionResult(go.GoClass):
|
|
855
817
|
return sv + '}'
|
856
818
|
def __repr__(self):
|
857
819
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
858
|
-
sv = 'api.
|
820
|
+
sv = 'api.VMCompatibilityShim ( '
|
859
821
|
for v in pr:
|
860
822
|
if not callable(v[1]):
|
861
823
|
sv += v[0] + '=' + str(v[1]) + ', '
|
862
824
|
return sv + ')'
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
return
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
_api.api_ExecutionResult_Value_Set(self.handle, value.handle)
|
872
|
-
else:
|
873
|
-
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
874
|
-
@property
|
875
|
-
def RawValue(self):
|
876
|
-
"""Raw Objective-LOL value (for advanced use)
|
877
|
-
"""
|
878
|
-
return go.environment_Value(handle=_api.api_ExecutionResult_RawValue_Get(self.handle))
|
879
|
-
@RawValue.setter
|
880
|
-
def RawValue(self, value):
|
881
|
-
if isinstance(value, go.GoClass):
|
882
|
-
_api.api_ExecutionResult_RawValue_Set(self.handle, value.handle)
|
883
|
-
else:
|
884
|
-
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
885
|
-
@property
|
886
|
-
def Output(self):
|
887
|
-
"""Output captured during execution (if configured)
|
825
|
+
def DefineFunction(self, id, name, argc, function):
|
826
|
+
"""DefineFunction(str id, str name, int argc, callable function) str
|
827
|
+
|
828
|
+
DefineFunction defines a global function with maximum compatibility,
|
829
|
+
wrapping arguments and return values as JSON strings.
|
830
|
+
An optional id cookie is passed back to the function to identify it.
|
831
|
+
jsonArgs is a JSON array string of the arguments.
|
832
|
+
The function should return a JSON object string with "result" and "error" fields.
|
888
833
|
"""
|
889
|
-
return _api.
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
834
|
+
return _api.api_VMCompatibilityShim_DefineFunction(self.handle, id, name, argc, function)
|
835
|
+
def BuildNewClassVariableWithGetter(self, variable, getterID, getter):
|
836
|
+
"""BuildNewClassVariableWithGetter(object variable, str getterID, callable getter) object"""
|
837
|
+
return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithGetter(self.handle, variable.handle, getterID, getter))
|
838
|
+
def BuildNewClassVariableWithSetter(self, variable, setterID, setter):
|
839
|
+
"""BuildNewClassVariableWithSetter(object variable, str setterID, callable setter) object"""
|
840
|
+
return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithSetter(self.handle, variable.handle, setterID, setter))
|
841
|
+
def BuildNewClassMethod(self, method, id, function):
|
842
|
+
"""BuildNewClassMethod(object method, str id, callable function) object"""
|
843
|
+
return ClassMethod(handle=_api.api_VMCompatibilityShim_BuildNewClassMethod(self.handle, method.handle, id, function))
|
844
|
+
def BuildNewUnknownFunctionHandler(self, id, function):
|
845
|
+
"""BuildNewUnknownFunctionHandler(str id, callable function) object"""
|
846
|
+
return UnknownFunctionHandler(handle=_api.api_VMCompatibilityShim_BuildNewUnknownFunctionHandler(self.handle, id, function))
|
847
|
+
def IsClassDefined(self, name):
|
848
|
+
"""IsClassDefined(str name) bool"""
|
849
|
+
return _api.api_VMCompatibilityShim_IsClassDefined(self.handle, name)
|
850
|
+
def LookupObject(self, id):
|
851
|
+
"""LookupObject(str id) object, str"""
|
852
|
+
return GoValue(handle=_api.api_VMCompatibilityShim_LookupObject(self.handle, id))
|
853
|
+
def GetObjectMRO(self, id):
|
854
|
+
"""GetObjectMRO(str id) []str, str"""
|
855
|
+
return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectMRO(self.handle, id))
|
856
|
+
def GetObjectImmediateFunctions(self, id):
|
857
|
+
"""GetObjectImmediateFunctions(str id) []str, str"""
|
858
|
+
return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateFunctions(self.handle, id))
|
859
|
+
def GetObjectImmediateVariables(self, id):
|
860
|
+
"""GetObjectImmediateVariables(str id) []str, str"""
|
861
|
+
return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateVariables(self.handle, id))
|
862
|
+
def AddVariableToObject(self, id, variable):
|
863
|
+
"""AddVariableToObject(str id, object variable) str"""
|
864
|
+
return _api.api_VMCompatibilityShim_AddVariableToObject(self.handle, id, variable.handle)
|
896
865
|
|
897
|
-
# Python type for struct api.
|
898
|
-
class
|
899
|
-
""""""
|
866
|
+
# Python type for struct api.VMConfig
|
867
|
+
class VMConfig(go.GoClass):
|
868
|
+
"""VMConfig holds configuration options for the VM\n"""
|
900
869
|
def __init__(self, *args, **kwargs):
|
901
870
|
"""
|
902
871
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
@@ -910,13 +879,29 @@ class GoValue(go.GoClass):
|
|
910
879
|
self.handle = args[0].handle
|
911
880
|
_api.IncRef(self.handle)
|
912
881
|
else:
|
913
|
-
self.handle = _api.
|
882
|
+
self.handle = _api.api_VMConfig_CTor()
|
914
883
|
_api.IncRef(self.handle)
|
884
|
+
if 0 < len(args):
|
885
|
+
self.Stdout = args[0]
|
886
|
+
if "Stdout" in kwargs:
|
887
|
+
self.Stdout = kwargs["Stdout"]
|
888
|
+
if 1 < len(args):
|
889
|
+
self.Stdin = args[1]
|
890
|
+
if "Stdin" in kwargs:
|
891
|
+
self.Stdin = kwargs["Stdin"]
|
892
|
+
if 2 < len(args):
|
893
|
+
self.Timeout = args[2]
|
894
|
+
if "Timeout" in kwargs:
|
895
|
+
self.Timeout = kwargs["Timeout"]
|
896
|
+
if 3 < len(args):
|
897
|
+
self.WorkingDirectory = args[3]
|
898
|
+
if "WorkingDirectory" in kwargs:
|
899
|
+
self.WorkingDirectory = kwargs["WorkingDirectory"]
|
915
900
|
def __del__(self):
|
916
901
|
_api.DecRef(self.handle)
|
917
902
|
def __str__(self):
|
918
903
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
919
|
-
sv = 'api.
|
904
|
+
sv = 'api.VMConfig{'
|
920
905
|
first = True
|
921
906
|
for v in pr:
|
922
907
|
if callable(v[1]):
|
@@ -929,45 +914,61 @@ class GoValue(go.GoClass):
|
|
929
914
|
return sv + '}'
|
930
915
|
def __repr__(self):
|
931
916
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
932
|
-
sv = 'api.
|
917
|
+
sv = 'api.VMConfig ( '
|
933
918
|
for v in pr:
|
934
919
|
if not callable(v[1]):
|
935
920
|
sv += v[0] + '=' + str(v[1]) + ', '
|
936
921
|
return sv + ')'
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
def
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
def
|
950
|
-
|
951
|
-
|
952
|
-
def
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
def
|
959
|
-
"""
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
922
|
+
@property
|
923
|
+
def Stdout(self):
|
924
|
+
"""I/O configuration
|
925
|
+
"""
|
926
|
+
return go.io_Writer(handle=_api.api_VMConfig_Stdout_Get(self.handle))
|
927
|
+
@Stdout.setter
|
928
|
+
def Stdout(self, value):
|
929
|
+
if isinstance(value, go.GoClass):
|
930
|
+
_api.api_VMConfig_Stdout_Set(self.handle, value.handle)
|
931
|
+
else:
|
932
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
933
|
+
@property
|
934
|
+
def Stdin(self):
|
935
|
+
return go.io_Reader(handle=_api.api_VMConfig_Stdin_Get(self.handle))
|
936
|
+
@Stdin.setter
|
937
|
+
def Stdin(self, value):
|
938
|
+
if isinstance(value, go.GoClass):
|
939
|
+
_api.api_VMConfig_Stdin_Set(self.handle, value.handle)
|
940
|
+
else:
|
941
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
942
|
+
@property
|
943
|
+
def Timeout(self):
|
944
|
+
"""Execution configuration
|
945
|
+
"""
|
946
|
+
return _api.api_VMConfig_Timeout_Get(self.handle)
|
947
|
+
@Timeout.setter
|
948
|
+
def Timeout(self, value):
|
949
|
+
if isinstance(value, go.GoClass):
|
950
|
+
_api.api_VMConfig_Timeout_Set(self.handle, value.handle)
|
951
|
+
else:
|
952
|
+
_api.api_VMConfig_Timeout_Set(self.handle, value)
|
953
|
+
@property
|
954
|
+
def WorkingDirectory(self):
|
955
|
+
return _api.api_VMConfig_WorkingDirectory_Get(self.handle)
|
956
|
+
@WorkingDirectory.setter
|
957
|
+
def WorkingDirectory(self, value):
|
958
|
+
if isinstance(value, go.GoClass):
|
959
|
+
_api.api_VMConfig_WorkingDirectory_Set(self.handle, value.handle)
|
960
|
+
else:
|
961
|
+
_api.api_VMConfig_WorkingDirectory_Set(self.handle, value)
|
962
|
+
def Validate(self):
|
963
|
+
"""Validate() str
|
964
|
+
|
965
|
+
Validate checks if the configuration is valid
|
966
|
+
"""
|
967
|
+
return _api.api_VMConfig_Validate(self.handle)
|
967
968
|
|
968
|
-
# Python type for struct api.
|
969
|
-
class
|
970
|
-
"""
|
969
|
+
# Python type for struct api.VMError
|
970
|
+
class VMError(go.GoClass):
|
971
|
+
"""VMError represents errors that can occur in the VM API\n"""
|
971
972
|
def __init__(self, *args, **kwargs):
|
972
973
|
"""
|
973
974
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
@@ -981,25 +982,29 @@ class SourceLocation(go.GoClass):
|
|
981
982
|
self.handle = args[0].handle
|
982
983
|
_api.IncRef(self.handle)
|
983
984
|
else:
|
984
|
-
self.handle = _api.
|
985
|
+
self.handle = _api.api_VMError_CTor()
|
985
986
|
_api.IncRef(self.handle)
|
986
987
|
if 0 < len(args):
|
987
|
-
self.
|
988
|
-
if "
|
989
|
-
self.
|
988
|
+
self.Type = args[0]
|
989
|
+
if "Type" in kwargs:
|
990
|
+
self.Type = kwargs["Type"]
|
990
991
|
if 1 < len(args):
|
991
|
-
self.
|
992
|
-
if "
|
993
|
-
self.
|
992
|
+
self.Message = args[1]
|
993
|
+
if "Message" in kwargs:
|
994
|
+
self.Message = kwargs["Message"]
|
994
995
|
if 2 < len(args):
|
995
|
-
self.
|
996
|
-
if "
|
997
|
-
self.
|
996
|
+
self.Source = args[2]
|
997
|
+
if "Source" in kwargs:
|
998
|
+
self.Source = kwargs["Source"]
|
999
|
+
if 4 < len(args):
|
1000
|
+
self.Duration = args[4]
|
1001
|
+
if "Duration" in kwargs:
|
1002
|
+
self.Duration = kwargs["Duration"]
|
998
1003
|
def __del__(self):
|
999
1004
|
_api.DecRef(self.handle)
|
1000
1005
|
def __str__(self):
|
1001
1006
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1002
|
-
sv = 'api.
|
1007
|
+
sv = 'api.VMError{'
|
1003
1008
|
first = True
|
1004
1009
|
for v in pr:
|
1005
1010
|
if callable(v[1]):
|
@@ -1012,41 +1017,86 @@ class SourceLocation(go.GoClass):
|
|
1012
1017
|
return sv + '}'
|
1013
1018
|
def __repr__(self):
|
1014
1019
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1015
|
-
sv = 'api.
|
1020
|
+
sv = 'api.VMError ( '
|
1016
1021
|
for v in pr:
|
1017
1022
|
if not callable(v[1]):
|
1018
1023
|
sv += v[0] + '=' + str(v[1]) + ', '
|
1019
1024
|
return sv + ')'
|
1020
1025
|
@property
|
1021
|
-
def
|
1022
|
-
return _api.
|
1023
|
-
@
|
1024
|
-
def
|
1026
|
+
def Type(self):
|
1027
|
+
return _api.api_VMError_Type_Get(self.handle)
|
1028
|
+
@Type.setter
|
1029
|
+
def Type(self, value):
|
1025
1030
|
if isinstance(value, go.GoClass):
|
1026
|
-
_api.
|
1031
|
+
_api.api_VMError_Type_Set(self.handle, value.handle)
|
1027
1032
|
else:
|
1028
|
-
_api.
|
1033
|
+
_api.api_VMError_Type_Set(self.handle, value)
|
1029
1034
|
@property
|
1030
|
-
def
|
1031
|
-
return _api.
|
1032
|
-
@
|
1033
|
-
def
|
1035
|
+
def Message(self):
|
1036
|
+
return _api.api_VMError_Message_Get(self.handle)
|
1037
|
+
@Message.setter
|
1038
|
+
def Message(self, value):
|
1034
1039
|
if isinstance(value, go.GoClass):
|
1035
|
-
_api.
|
1040
|
+
_api.api_VMError_Message_Set(self.handle, value.handle)
|
1036
1041
|
else:
|
1037
|
-
_api.
|
1042
|
+
_api.api_VMError_Message_Set(self.handle, value)
|
1038
1043
|
@property
|
1039
|
-
def
|
1040
|
-
return _api.
|
1041
|
-
@
|
1042
|
-
def
|
1044
|
+
def Source(self):
|
1045
|
+
return SourceLocation(handle=_api.api_VMError_Source_Get(self.handle))
|
1046
|
+
@Source.setter
|
1047
|
+
def Source(self, value):
|
1043
1048
|
if isinstance(value, go.GoClass):
|
1044
|
-
_api.
|
1049
|
+
_api.api_VMError_Source_Set(self.handle, value.handle)
|
1045
1050
|
else:
|
1046
|
-
|
1051
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
1052
|
+
@property
|
1053
|
+
def Duration(self):
|
1054
|
+
return _api.api_VMError_Duration_Get(self.handle)
|
1055
|
+
@Duration.setter
|
1056
|
+
def Duration(self, value):
|
1057
|
+
if isinstance(value, go.GoClass):
|
1058
|
+
_api.api_VMError_Duration_Set(self.handle, value.handle)
|
1059
|
+
else:
|
1060
|
+
_api.api_VMError_Duration_Set(self.handle, value)
|
1061
|
+
def Error(self):
|
1062
|
+
"""Error() str"""
|
1063
|
+
return _api.api_VMError_Error(self.handle)
|
1064
|
+
def Unwrap(self):
|
1065
|
+
"""Unwrap() str"""
|
1066
|
+
return _api.api_VMError_Unwrap(self.handle)
|
1067
|
+
def IsCompileError(self):
|
1068
|
+
"""IsCompileError() bool
|
1069
|
+
|
1070
|
+
IsCompileError returns true if the error is a compilation error
|
1071
|
+
"""
|
1072
|
+
return _api.api_VMError_IsCompileError(self.handle)
|
1073
|
+
def IsRuntimeError(self):
|
1074
|
+
"""IsRuntimeError() bool
|
1075
|
+
|
1076
|
+
IsRuntimeError returns true if the error is a runtime error
|
1077
|
+
"""
|
1078
|
+
return _api.api_VMError_IsRuntimeError(self.handle)
|
1079
|
+
def IsTimeoutError(self):
|
1080
|
+
"""IsTimeoutError() bool
|
1081
|
+
|
1082
|
+
IsTimeoutError returns true if the error is a timeout error
|
1083
|
+
"""
|
1084
|
+
return _api.api_VMError_IsTimeoutError(self.handle)
|
1085
|
+
def IsConversionError(self):
|
1086
|
+
"""IsConversionError() bool
|
1087
|
+
|
1088
|
+
IsConversionError returns true if the error is a type conversion error
|
1089
|
+
"""
|
1090
|
+
return _api.api_VMError_IsConversionError(self.handle)
|
1091
|
+
def IsConfigError(self):
|
1092
|
+
"""IsConfigError() bool
|
1093
|
+
|
1094
|
+
IsConfigError returns true if the error is a configuration error
|
1095
|
+
"""
|
1096
|
+
return _api.api_VMError_IsConfigError(self.handle)
|
1047
1097
|
|
1048
|
-
# Python type for struct api.
|
1049
|
-
class
|
1098
|
+
# Python type for struct api.ClassMethod
|
1099
|
+
class ClassMethod(go.GoClass):
|
1050
1100
|
""""""
|
1051
1101
|
def __init__(self, *args, **kwargs):
|
1052
1102
|
"""
|
@@ -1061,13 +1111,21 @@ class UnknownFunctionHandler(go.GoClass):
|
|
1061
1111
|
self.handle = args[0].handle
|
1062
1112
|
_api.IncRef(self.handle)
|
1063
1113
|
else:
|
1064
|
-
self.handle = _api.
|
1114
|
+
self.handle = _api.api_ClassMethod_CTor()
|
1065
1115
|
_api.IncRef(self.handle)
|
1116
|
+
if 0 < len(args):
|
1117
|
+
self.Name = args[0]
|
1118
|
+
if "Name" in kwargs:
|
1119
|
+
self.Name = kwargs["Name"]
|
1120
|
+
if 1 < len(args):
|
1121
|
+
self.Argc = args[1]
|
1122
|
+
if "Argc" in kwargs:
|
1123
|
+
self.Argc = kwargs["Argc"]
|
1066
1124
|
def __del__(self):
|
1067
1125
|
_api.DecRef(self.handle)
|
1068
1126
|
def __str__(self):
|
1069
1127
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1070
|
-
sv = 'api.
|
1128
|
+
sv = 'api.ClassMethod{'
|
1071
1129
|
first = True
|
1072
1130
|
for v in pr:
|
1073
1131
|
if callable(v[1]):
|
@@ -1080,15 +1138,33 @@ class UnknownFunctionHandler(go.GoClass):
|
|
1080
1138
|
return sv + '}'
|
1081
1139
|
def __repr__(self):
|
1082
1140
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1083
|
-
sv = 'api.
|
1141
|
+
sv = 'api.ClassMethod ( '
|
1084
1142
|
for v in pr:
|
1085
1143
|
if not callable(v[1]):
|
1086
1144
|
sv += v[0] + '=' + str(v[1]) + ', '
|
1087
1145
|
return sv + ')'
|
1146
|
+
@property
|
1147
|
+
def Name(self):
|
1148
|
+
return _api.api_ClassMethod_Name_Get(self.handle)
|
1149
|
+
@Name.setter
|
1150
|
+
def Name(self, value):
|
1151
|
+
if isinstance(value, go.GoClass):
|
1152
|
+
_api.api_ClassMethod_Name_Set(self.handle, value.handle)
|
1153
|
+
else:
|
1154
|
+
_api.api_ClassMethod_Name_Set(self.handle, value)
|
1155
|
+
@property
|
1156
|
+
def Argc(self):
|
1157
|
+
return _api.api_ClassMethod_Argc_Get(self.handle)
|
1158
|
+
@Argc.setter
|
1159
|
+
def Argc(self, value):
|
1160
|
+
if isinstance(value, go.GoClass):
|
1161
|
+
_api.api_ClassMethod_Argc_Set(self.handle, value.handle)
|
1162
|
+
else:
|
1163
|
+
_api.api_ClassMethod_Argc_Set(self.handle, value)
|
1088
1164
|
|
1089
|
-
# Python type for struct api.
|
1090
|
-
class
|
1091
|
-
"""
|
1165
|
+
# Python type for struct api.ClassVariable
|
1166
|
+
class ClassVariable(go.GoClass):
|
1167
|
+
""""""
|
1092
1168
|
def __init__(self, *args, **kwargs):
|
1093
1169
|
"""
|
1094
1170
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
@@ -1102,13 +1178,25 @@ class VM(go.GoClass):
|
|
1102
1178
|
self.handle = args[0].handle
|
1103
1179
|
_api.IncRef(self.handle)
|
1104
1180
|
else:
|
1105
|
-
self.handle = _api.
|
1181
|
+
self.handle = _api.api_ClassVariable_CTor()
|
1106
1182
|
_api.IncRef(self.handle)
|
1183
|
+
if 0 < len(args):
|
1184
|
+
self.Name = args[0]
|
1185
|
+
if "Name" in kwargs:
|
1186
|
+
self.Name = kwargs["Name"]
|
1187
|
+
if 1 < len(args):
|
1188
|
+
self.Value = args[1]
|
1189
|
+
if "Value" in kwargs:
|
1190
|
+
self.Value = kwargs["Value"]
|
1191
|
+
if 2 < len(args):
|
1192
|
+
self.Locked = args[2]
|
1193
|
+
if "Locked" in kwargs:
|
1194
|
+
self.Locked = kwargs["Locked"]
|
1107
1195
|
def __del__(self):
|
1108
1196
|
_api.DecRef(self.handle)
|
1109
1197
|
def __str__(self):
|
1110
1198
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1111
|
-
sv = 'api.
|
1199
|
+
sv = 'api.ClassVariable{'
|
1112
1200
|
first = True
|
1113
1201
|
for v in pr:
|
1114
1202
|
if callable(v[1]):
|
@@ -1121,69 +1209,42 @@ class VM(go.GoClass):
|
|
1121
1209
|
return sv + '}'
|
1122
1210
|
def __repr__(self):
|
1123
1211
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1124
|
-
sv = 'api.
|
1212
|
+
sv = 'api.ClassVariable ( '
|
1125
1213
|
for v in pr:
|
1126
1214
|
if not callable(v[1]):
|
1127
1215
|
sv += v[0] + '=' + str(v[1]) + ', '
|
1128
1216
|
return sv + ')'
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
return
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
return
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
def CallMethod(self, object, methodName, args):
|
1157
|
-
"""CallMethod(object object, str methodName, []object args) object, str
|
1158
|
-
|
1159
|
-
CallMethod calls a method on an Objective-LOL object
|
1160
|
-
"""
|
1161
|
-
return GoValue(handle=_api.api_VM_CallMethod(self.handle, object.handle, methodName, args.handle))
|
1162
|
-
def DefineVariable(self, name, value, constant):
|
1163
|
-
"""DefineVariable(str name, object value, bool constant) str
|
1164
|
-
|
1165
|
-
DefineVariable defines a global variable in the VM
|
1166
|
-
"""
|
1167
|
-
return _api.api_VM_DefineVariable(self.handle, name, value.handle, constant)
|
1168
|
-
def SetVariable(self, variableName, value):
|
1169
|
-
"""SetVariable(str variableName, object value) str
|
1170
|
-
|
1171
|
-
SetVariable sets a variable in the global environment
|
1172
|
-
"""
|
1173
|
-
return _api.api_VM_SetVariable(self.handle, variableName, value.handle)
|
1174
|
-
def GetVariable(self, variableName):
|
1175
|
-
"""GetVariable(str variableName) object, str
|
1176
|
-
|
1177
|
-
Get gets a variable from the global environment
|
1178
|
-
"""
|
1179
|
-
return GoValue(handle=_api.api_VM_GetVariable(self.handle, variableName))
|
1180
|
-
def DefineClass(self, classDef):
|
1181
|
-
"""DefineClass(object classDef) str"""
|
1182
|
-
return _api.api_VM_DefineClass(self.handle, classDef.handle)
|
1217
|
+
@property
|
1218
|
+
def Name(self):
|
1219
|
+
return _api.api_ClassVariable_Name_Get(self.handle)
|
1220
|
+
@Name.setter
|
1221
|
+
def Name(self, value):
|
1222
|
+
if isinstance(value, go.GoClass):
|
1223
|
+
_api.api_ClassVariable_Name_Set(self.handle, value.handle)
|
1224
|
+
else:
|
1225
|
+
_api.api_ClassVariable_Name_Set(self.handle, value)
|
1226
|
+
@property
|
1227
|
+
def Value(self):
|
1228
|
+
return GoValue(handle=_api.api_ClassVariable_Value_Get(self.handle))
|
1229
|
+
@Value.setter
|
1230
|
+
def Value(self, value):
|
1231
|
+
if isinstance(value, go.GoClass):
|
1232
|
+
_api.api_ClassVariable_Value_Set(self.handle, value.handle)
|
1233
|
+
else:
|
1234
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
1235
|
+
@property
|
1236
|
+
def Locked(self):
|
1237
|
+
return _api.api_ClassVariable_Locked_Get(self.handle)
|
1238
|
+
@Locked.setter
|
1239
|
+
def Locked(self, value):
|
1240
|
+
if isinstance(value, go.GoClass):
|
1241
|
+
_api.api_ClassVariable_Locked_Set(self.handle, value.handle)
|
1242
|
+
else:
|
1243
|
+
_api.api_ClassVariable_Locked_Set(self.handle, value)
|
1183
1244
|
|
1184
|
-
# Python type for struct api.
|
1185
|
-
class
|
1186
|
-
"""
|
1245
|
+
# Python type for struct api.ExecutionResult
|
1246
|
+
class ExecutionResult(go.GoClass):
|
1247
|
+
"""ExecutionResult represents the result of executing Objective-LOL code\n"""
|
1187
1248
|
def __init__(self, *args, **kwargs):
|
1188
1249
|
"""
|
1189
1250
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
@@ -1197,13 +1258,25 @@ class VMCompatibilityShim(go.GoClass):
|
|
1197
1258
|
self.handle = args[0].handle
|
1198
1259
|
_api.IncRef(self.handle)
|
1199
1260
|
else:
|
1200
|
-
self.handle = _api.
|
1261
|
+
self.handle = _api.api_ExecutionResult_CTor()
|
1201
1262
|
_api.IncRef(self.handle)
|
1263
|
+
if 0 < len(args):
|
1264
|
+
self.Value = args[0]
|
1265
|
+
if "Value" in kwargs:
|
1266
|
+
self.Value = kwargs["Value"]
|
1267
|
+
if 1 < len(args):
|
1268
|
+
self.RawValue = args[1]
|
1269
|
+
if "RawValue" in kwargs:
|
1270
|
+
self.RawValue = kwargs["RawValue"]
|
1271
|
+
if 2 < len(args):
|
1272
|
+
self.Output = args[2]
|
1273
|
+
if "Output" in kwargs:
|
1274
|
+
self.Output = kwargs["Output"]
|
1202
1275
|
def __del__(self):
|
1203
1276
|
_api.DecRef(self.handle)
|
1204
1277
|
def __str__(self):
|
1205
1278
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1206
|
-
sv = 'api.
|
1279
|
+
sv = 'api.ExecutionResult{'
|
1207
1280
|
first = True
|
1208
1281
|
for v in pr:
|
1209
1282
|
if callable(v[1]):
|
@@ -1216,51 +1289,139 @@ class VMCompatibilityShim(go.GoClass):
|
|
1216
1289
|
return sv + '}'
|
1217
1290
|
def __repr__(self):
|
1218
1291
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1219
|
-
sv = 'api.
|
1292
|
+
sv = 'api.ExecutionResult ( '
|
1220
1293
|
for v in pr:
|
1221
1294
|
if not callable(v[1]):
|
1222
1295
|
sv += v[0] + '=' + str(v[1]) + ', '
|
1223
1296
|
return sv + ')'
|
1224
|
-
|
1225
|
-
|
1297
|
+
@property
|
1298
|
+
def Value(self):
|
1299
|
+
"""Return value from the execution (e.g., from MAIN function)
|
1300
|
+
"""
|
1301
|
+
return GoValue(handle=_api.api_ExecutionResult_Value_Get(self.handle))
|
1302
|
+
@Value.setter
|
1303
|
+
def Value(self, value):
|
1304
|
+
if isinstance(value, go.GoClass):
|
1305
|
+
_api.api_ExecutionResult_Value_Set(self.handle, value.handle)
|
1306
|
+
else:
|
1307
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
1308
|
+
@property
|
1309
|
+
def RawValue(self):
|
1310
|
+
"""Raw Objective-LOL value (for advanced use)
|
1311
|
+
"""
|
1312
|
+
return go.environment_Value(handle=_api.api_ExecutionResult_RawValue_Get(self.handle))
|
1313
|
+
@RawValue.setter
|
1314
|
+
def RawValue(self, value):
|
1315
|
+
if isinstance(value, go.GoClass):
|
1316
|
+
_api.api_ExecutionResult_RawValue_Set(self.handle, value.handle)
|
1317
|
+
else:
|
1318
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
1319
|
+
@property
|
1320
|
+
def Output(self):
|
1321
|
+
"""Output captured during execution (if configured)
|
1322
|
+
"""
|
1323
|
+
return _api.api_ExecutionResult_Output_Get(self.handle)
|
1324
|
+
@Output.setter
|
1325
|
+
def Output(self, value):
|
1326
|
+
if isinstance(value, go.GoClass):
|
1327
|
+
_api.api_ExecutionResult_Output_Set(self.handle, value.handle)
|
1328
|
+
else:
|
1329
|
+
_api.api_ExecutionResult_Output_Set(self.handle, value)
|
1330
|
+
|
1331
|
+
# Python type for struct api.VM
|
1332
|
+
class VM(go.GoClass):
|
1333
|
+
"""VM represents an Objective-LOL virtual machine instance\n"""
|
1334
|
+
def __init__(self, *args, **kwargs):
|
1335
|
+
"""
|
1336
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
1337
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
1338
|
+
in which case a new Go object is constructed first
|
1339
|
+
"""
|
1340
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
1341
|
+
self.handle = kwargs['handle']
|
1342
|
+
_api.IncRef(self.handle)
|
1343
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
1344
|
+
self.handle = args[0].handle
|
1345
|
+
_api.IncRef(self.handle)
|
1346
|
+
else:
|
1347
|
+
self.handle = _api.api_VM_CTor()
|
1348
|
+
_api.IncRef(self.handle)
|
1349
|
+
def __del__(self):
|
1350
|
+
_api.DecRef(self.handle)
|
1351
|
+
def __str__(self):
|
1352
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1353
|
+
sv = 'api.VM{'
|
1354
|
+
first = True
|
1355
|
+
for v in pr:
|
1356
|
+
if callable(v[1]):
|
1357
|
+
continue
|
1358
|
+
if first:
|
1359
|
+
first = False
|
1360
|
+
else:
|
1361
|
+
sv += ', '
|
1362
|
+
sv += v[0] + '=' + str(v[1])
|
1363
|
+
return sv + '}'
|
1364
|
+
def __repr__(self):
|
1365
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1366
|
+
sv = 'api.VM ( '
|
1367
|
+
for v in pr:
|
1368
|
+
if not callable(v[1]):
|
1369
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
1370
|
+
return sv + ')'
|
1371
|
+
def GetCompatibilityShim(self):
|
1372
|
+
"""GetCompatibilityShim() object
|
1226
1373
|
|
1227
|
-
|
1228
|
-
wrapping arguments and return values as JSON strings.
|
1229
|
-
An optional id cookie is passed back to the function to identify it.
|
1230
|
-
jsonArgs is a JSON array string of the arguments.
|
1231
|
-
The function should return a JSON object string with "result" and "error" fields.
|
1374
|
+
GetCompatibilityShim returns a compatibility shim for the VM
|
1232
1375
|
"""
|
1233
|
-
return _api.
|
1234
|
-
def
|
1235
|
-
"""
|
1236
|
-
|
1237
|
-
|
1238
|
-
"""
|
1239
|
-
return
|
1240
|
-
def
|
1241
|
-
"""
|
1242
|
-
|
1243
|
-
|
1244
|
-
"""
|
1245
|
-
return
|
1246
|
-
def
|
1247
|
-
"""
|
1248
|
-
return _api.
|
1249
|
-
def
|
1250
|
-
"""
|
1251
|
-
|
1252
|
-
|
1253
|
-
"""
|
1254
|
-
return
|
1255
|
-
def
|
1256
|
-
"""
|
1257
|
-
|
1258
|
-
|
1259
|
-
"""
|
1260
|
-
return
|
1261
|
-
def
|
1262
|
-
"""
|
1263
|
-
|
1376
|
+
return VMCompatibilityShim(handle=_api.api_VM_GetCompatibilityShim(self.handle))
|
1377
|
+
def Execute(self, code):
|
1378
|
+
"""Execute(str code) object, str
|
1379
|
+
|
1380
|
+
Execute executes Objective-LOL code from a string
|
1381
|
+
"""
|
1382
|
+
return ExecutionResult(handle=_api.api_VM_Execute(self.handle, code))
|
1383
|
+
def ExecuteWithContext(self, ctx, code):
|
1384
|
+
"""ExecuteWithContext(object ctx, str code) object, str
|
1385
|
+
|
1386
|
+
ExecuteWithContext executes code with a context for cancellation/timeout
|
1387
|
+
"""
|
1388
|
+
return ExecutionResult(handle=_api.api_VM_ExecuteWithContext(self.handle, ctx.handle, code))
|
1389
|
+
def NewObjectInstance(self, className):
|
1390
|
+
"""NewObjectInstance(str className) object, str"""
|
1391
|
+
return GoValue(handle=_api.api_VM_NewObjectInstance(self.handle, className))
|
1392
|
+
def Call(self, functionName, args):
|
1393
|
+
"""Call(str functionName, []object args) object, str
|
1394
|
+
|
1395
|
+
Call calls an Objective-LOL function with the given arguments
|
1396
|
+
"""
|
1397
|
+
return GoValue(handle=_api.api_VM_Call(self.handle, functionName, args.handle))
|
1398
|
+
def CallMethod(self, object, methodName, args):
|
1399
|
+
"""CallMethod(object object, str methodName, []object args) object, str
|
1400
|
+
|
1401
|
+
CallMethod calls a method on an Objective-LOL object
|
1402
|
+
"""
|
1403
|
+
return GoValue(handle=_api.api_VM_CallMethod(self.handle, object.handle, methodName, args.handle))
|
1404
|
+
def DefineVariable(self, name, value, constant):
|
1405
|
+
"""DefineVariable(str name, object value, bool constant) str
|
1406
|
+
|
1407
|
+
DefineVariable defines a global variable in the VM
|
1408
|
+
"""
|
1409
|
+
return _api.api_VM_DefineVariable(self.handle, name, value.handle, constant)
|
1410
|
+
def SetVariable(self, variableName, value):
|
1411
|
+
"""SetVariable(str variableName, object value) str
|
1412
|
+
|
1413
|
+
SetVariable sets a variable in the global environment
|
1414
|
+
"""
|
1415
|
+
return _api.api_VM_SetVariable(self.handle, variableName, value.handle)
|
1416
|
+
def GetVariable(self, variableName):
|
1417
|
+
"""GetVariable(str variableName) object, str
|
1418
|
+
|
1419
|
+
Get gets a variable from the global environment
|
1420
|
+
"""
|
1421
|
+
return GoValue(handle=_api.api_VM_GetVariable(self.handle, variableName))
|
1422
|
+
def DefineClass(self, classDef):
|
1423
|
+
"""DefineClass(object classDef) str"""
|
1424
|
+
return _api.api_VM_DefineClass(self.handle, classDef.handle)
|
1264
1425
|
|
1265
1426
|
# Python type for struct api.ClassDefinition
|
1266
1427
|
class ClassDefinition(go.GoClass):
|
@@ -1394,8 +1555,8 @@ class ClassDefinition(go.GoClass):
|
|
1394
1555
|
else:
|
1395
1556
|
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
1396
1557
|
|
1397
|
-
# Python type for struct api.
|
1398
|
-
class
|
1558
|
+
# Python type for struct api.GoValue
|
1559
|
+
class GoValue(go.GoClass):
|
1399
1560
|
""""""
|
1400
1561
|
def __init__(self, *args, **kwargs):
|
1401
1562
|
"""
|
@@ -1410,25 +1571,13 @@ class ClassVariable(go.GoClass):
|
|
1410
1571
|
self.handle = args[0].handle
|
1411
1572
|
_api.IncRef(self.handle)
|
1412
1573
|
else:
|
1413
|
-
self.handle = _api.
|
1574
|
+
self.handle = _api.api_GoValue_CTor()
|
1414
1575
|
_api.IncRef(self.handle)
|
1415
|
-
if 0 < len(args):
|
1416
|
-
self.Name = args[0]
|
1417
|
-
if "Name" in kwargs:
|
1418
|
-
self.Name = kwargs["Name"]
|
1419
|
-
if 1 < len(args):
|
1420
|
-
self.Value = args[1]
|
1421
|
-
if "Value" in kwargs:
|
1422
|
-
self.Value = kwargs["Value"]
|
1423
|
-
if 2 < len(args):
|
1424
|
-
self.Locked = args[2]
|
1425
|
-
if "Locked" in kwargs:
|
1426
|
-
self.Locked = kwargs["Locked"]
|
1427
1576
|
def __del__(self):
|
1428
1577
|
_api.DecRef(self.handle)
|
1429
1578
|
def __str__(self):
|
1430
1579
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1431
|
-
sv = 'api.
|
1580
|
+
sv = 'api.GoValue{'
|
1432
1581
|
first = True
|
1433
1582
|
for v in pr:
|
1434
1583
|
if callable(v[1]):
|
@@ -1441,42 +1590,45 @@ class ClassVariable(go.GoClass):
|
|
1441
1590
|
return sv + '}'
|
1442
1591
|
def __repr__(self):
|
1443
1592
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1444
|
-
sv = 'api.
|
1593
|
+
sv = 'api.GoValue ( '
|
1445
1594
|
for v in pr:
|
1446
1595
|
if not callable(v[1]):
|
1447
1596
|
sv += v[0] + '=' + str(v[1]) + ', '
|
1448
1597
|
return sv + ')'
|
1449
|
-
|
1450
|
-
|
1451
|
-
return _api.
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
return
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
return _api.
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1598
|
+
def ID(self):
|
1599
|
+
"""ID() str"""
|
1600
|
+
return _api.api_GoValue_ID(self.handle)
|
1601
|
+
def MarshalJSON(self):
|
1602
|
+
"""MarshalJSON() []int, str"""
|
1603
|
+
return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
|
1604
|
+
def Type(self):
|
1605
|
+
"""Type() str"""
|
1606
|
+
return _api.api_GoValue_Type(self.handle)
|
1607
|
+
def Int(self):
|
1608
|
+
"""Int() long, str"""
|
1609
|
+
return _api.api_GoValue_Int(self.handle)
|
1610
|
+
def Float(self):
|
1611
|
+
"""Float() float, str"""
|
1612
|
+
return _api.api_GoValue_Float(self.handle)
|
1613
|
+
def String(self):
|
1614
|
+
"""String() str, str"""
|
1615
|
+
return _api.api_GoValue_String(self.handle)
|
1616
|
+
def Bool(self):
|
1617
|
+
"""Bool() bool, str"""
|
1618
|
+
return _api.api_GoValue_Bool(self.handle)
|
1619
|
+
def Slice(self):
|
1620
|
+
"""Slice() []object, str"""
|
1621
|
+
return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
|
1622
|
+
def Map(self):
|
1623
|
+
"""Map() object, str"""
|
1624
|
+
return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
|
1625
|
+
def Object(self):
|
1626
|
+
"""Object() object, str"""
|
1627
|
+
return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
|
1476
1628
|
|
1477
|
-
# Python type for struct api.
|
1478
|
-
class
|
1479
|
-
"""
|
1629
|
+
# Python type for struct api.SourceLocation
|
1630
|
+
class SourceLocation(go.GoClass):
|
1631
|
+
"""SourceLocation represents a location in source code\n"""
|
1480
1632
|
def __init__(self, *args, **kwargs):
|
1481
1633
|
"""
|
1482
1634
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
@@ -1490,132 +1642,25 @@ class VMConfig(go.GoClass):
|
|
1490
1642
|
self.handle = args[0].handle
|
1491
1643
|
_api.IncRef(self.handle)
|
1492
1644
|
else:
|
1493
|
-
self.handle = _api.
|
1645
|
+
self.handle = _api.api_SourceLocation_CTor()
|
1494
1646
|
_api.IncRef(self.handle)
|
1495
1647
|
if 0 < len(args):
|
1496
|
-
self.
|
1497
|
-
if "
|
1498
|
-
self.
|
1499
|
-
if 1 < len(args):
|
1500
|
-
self.Stdin = args[1]
|
1501
|
-
if "Stdin" in kwargs:
|
1502
|
-
self.Stdin = kwargs["Stdin"]
|
1503
|
-
if 2 < len(args):
|
1504
|
-
self.Timeout = args[2]
|
1505
|
-
if "Timeout" in kwargs:
|
1506
|
-
self.Timeout = kwargs["Timeout"]
|
1507
|
-
if 3 < len(args):
|
1508
|
-
self.WorkingDirectory = args[3]
|
1509
|
-
if "WorkingDirectory" in kwargs:
|
1510
|
-
self.WorkingDirectory = kwargs["WorkingDirectory"]
|
1511
|
-
def __del__(self):
|
1512
|
-
_api.DecRef(self.handle)
|
1513
|
-
def __str__(self):
|
1514
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1515
|
-
sv = 'api.VMConfig{'
|
1516
|
-
first = True
|
1517
|
-
for v in pr:
|
1518
|
-
if callable(v[1]):
|
1519
|
-
continue
|
1520
|
-
if first:
|
1521
|
-
first = False
|
1522
|
-
else:
|
1523
|
-
sv += ', '
|
1524
|
-
sv += v[0] + '=' + str(v[1])
|
1525
|
-
return sv + '}'
|
1526
|
-
def __repr__(self):
|
1527
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1528
|
-
sv = 'api.VMConfig ( '
|
1529
|
-
for v in pr:
|
1530
|
-
if not callable(v[1]):
|
1531
|
-
sv += v[0] + '=' + str(v[1]) + ', '
|
1532
|
-
return sv + ')'
|
1533
|
-
@property
|
1534
|
-
def Stdout(self):
|
1535
|
-
"""I/O configuration
|
1536
|
-
"""
|
1537
|
-
return go.io_Writer(handle=_api.api_VMConfig_Stdout_Get(self.handle))
|
1538
|
-
@Stdout.setter
|
1539
|
-
def Stdout(self, value):
|
1540
|
-
if isinstance(value, go.GoClass):
|
1541
|
-
_api.api_VMConfig_Stdout_Set(self.handle, value.handle)
|
1542
|
-
else:
|
1543
|
-
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
1544
|
-
@property
|
1545
|
-
def Stdin(self):
|
1546
|
-
return go.io_Reader(handle=_api.api_VMConfig_Stdin_Get(self.handle))
|
1547
|
-
@Stdin.setter
|
1548
|
-
def Stdin(self, value):
|
1549
|
-
if isinstance(value, go.GoClass):
|
1550
|
-
_api.api_VMConfig_Stdin_Set(self.handle, value.handle)
|
1551
|
-
else:
|
1552
|
-
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
1553
|
-
@property
|
1554
|
-
def Timeout(self):
|
1555
|
-
"""Execution configuration
|
1556
|
-
"""
|
1557
|
-
return _api.api_VMConfig_Timeout_Get(self.handle)
|
1558
|
-
@Timeout.setter
|
1559
|
-
def Timeout(self, value):
|
1560
|
-
if isinstance(value, go.GoClass):
|
1561
|
-
_api.api_VMConfig_Timeout_Set(self.handle, value.handle)
|
1562
|
-
else:
|
1563
|
-
_api.api_VMConfig_Timeout_Set(self.handle, value)
|
1564
|
-
@property
|
1565
|
-
def WorkingDirectory(self):
|
1566
|
-
return _api.api_VMConfig_WorkingDirectory_Get(self.handle)
|
1567
|
-
@WorkingDirectory.setter
|
1568
|
-
def WorkingDirectory(self, value):
|
1569
|
-
if isinstance(value, go.GoClass):
|
1570
|
-
_api.api_VMConfig_WorkingDirectory_Set(self.handle, value.handle)
|
1571
|
-
else:
|
1572
|
-
_api.api_VMConfig_WorkingDirectory_Set(self.handle, value)
|
1573
|
-
def Validate(self):
|
1574
|
-
"""Validate() str
|
1575
|
-
|
1576
|
-
Validate checks if the configuration is valid
|
1577
|
-
"""
|
1578
|
-
return _api.api_VMConfig_Validate(self.handle)
|
1579
|
-
|
1580
|
-
# Python type for struct api.VMError
|
1581
|
-
class VMError(go.GoClass):
|
1582
|
-
"""VMError represents errors that can occur in the VM API\n"""
|
1583
|
-
def __init__(self, *args, **kwargs):
|
1584
|
-
"""
|
1585
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
1586
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
1587
|
-
in which case a new Go object is constructed first
|
1588
|
-
"""
|
1589
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
1590
|
-
self.handle = kwargs['handle']
|
1591
|
-
_api.IncRef(self.handle)
|
1592
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
1593
|
-
self.handle = args[0].handle
|
1594
|
-
_api.IncRef(self.handle)
|
1595
|
-
else:
|
1596
|
-
self.handle = _api.api_VMError_CTor()
|
1597
|
-
_api.IncRef(self.handle)
|
1598
|
-
if 0 < len(args):
|
1599
|
-
self.Type = args[0]
|
1600
|
-
if "Type" in kwargs:
|
1601
|
-
self.Type = kwargs["Type"]
|
1648
|
+
self.Filename = args[0]
|
1649
|
+
if "Filename" in kwargs:
|
1650
|
+
self.Filename = kwargs["Filename"]
|
1602
1651
|
if 1 < len(args):
|
1603
|
-
self.
|
1604
|
-
if "
|
1605
|
-
self.
|
1652
|
+
self.Line = args[1]
|
1653
|
+
if "Line" in kwargs:
|
1654
|
+
self.Line = kwargs["Line"]
|
1606
1655
|
if 2 < len(args):
|
1607
|
-
self.
|
1608
|
-
if "
|
1609
|
-
self.
|
1610
|
-
if 4 < len(args):
|
1611
|
-
self.Duration = args[4]
|
1612
|
-
if "Duration" in kwargs:
|
1613
|
-
self.Duration = kwargs["Duration"]
|
1656
|
+
self.Column = args[2]
|
1657
|
+
if "Column" in kwargs:
|
1658
|
+
self.Column = kwargs["Column"]
|
1614
1659
|
def __del__(self):
|
1615
1660
|
_api.DecRef(self.handle)
|
1616
1661
|
def __str__(self):
|
1617
1662
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1618
|
-
sv = 'api.
|
1663
|
+
sv = 'api.SourceLocation{'
|
1619
1664
|
first = True
|
1620
1665
|
for v in pr:
|
1621
1666
|
if callable(v[1]):
|
@@ -1628,83 +1673,38 @@ class VMError(go.GoClass):
|
|
1628
1673
|
return sv + '}'
|
1629
1674
|
def __repr__(self):
|
1630
1675
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
1631
|
-
sv = 'api.
|
1676
|
+
sv = 'api.SourceLocation ( '
|
1632
1677
|
for v in pr:
|
1633
1678
|
if not callable(v[1]):
|
1634
1679
|
sv += v[0] + '=' + str(v[1]) + ', '
|
1635
1680
|
return sv + ')'
|
1636
1681
|
@property
|
1637
|
-
def
|
1638
|
-
return _api.
|
1639
|
-
@
|
1640
|
-
def
|
1641
|
-
if isinstance(value, go.GoClass):
|
1642
|
-
_api.api_VMError_Type_Set(self.handle, value.handle)
|
1643
|
-
else:
|
1644
|
-
_api.api_VMError_Type_Set(self.handle, value)
|
1645
|
-
@property
|
1646
|
-
def Message(self):
|
1647
|
-
return _api.api_VMError_Message_Get(self.handle)
|
1648
|
-
@Message.setter
|
1649
|
-
def Message(self, value):
|
1682
|
+
def Filename(self):
|
1683
|
+
return _api.api_SourceLocation_Filename_Get(self.handle)
|
1684
|
+
@Filename.setter
|
1685
|
+
def Filename(self, value):
|
1650
1686
|
if isinstance(value, go.GoClass):
|
1651
|
-
_api.
|
1687
|
+
_api.api_SourceLocation_Filename_Set(self.handle, value.handle)
|
1652
1688
|
else:
|
1653
|
-
_api.
|
1689
|
+
_api.api_SourceLocation_Filename_Set(self.handle, value)
|
1654
1690
|
@property
|
1655
|
-
def
|
1656
|
-
return
|
1657
|
-
@
|
1658
|
-
def
|
1691
|
+
def Line(self):
|
1692
|
+
return _api.api_SourceLocation_Line_Get(self.handle)
|
1693
|
+
@Line.setter
|
1694
|
+
def Line(self, value):
|
1659
1695
|
if isinstance(value, go.GoClass):
|
1660
|
-
_api.
|
1696
|
+
_api.api_SourceLocation_Line_Set(self.handle, value.handle)
|
1661
1697
|
else:
|
1662
|
-
|
1698
|
+
_api.api_SourceLocation_Line_Set(self.handle, value)
|
1663
1699
|
@property
|
1664
|
-
def
|
1665
|
-
return _api.
|
1666
|
-
@
|
1667
|
-
def
|
1700
|
+
def Column(self):
|
1701
|
+
return _api.api_SourceLocation_Column_Get(self.handle)
|
1702
|
+
@Column.setter
|
1703
|
+
def Column(self, value):
|
1668
1704
|
if isinstance(value, go.GoClass):
|
1669
|
-
_api.
|
1705
|
+
_api.api_SourceLocation_Column_Set(self.handle, value.handle)
|
1670
1706
|
else:
|
1671
|
-
_api.
|
1672
|
-
def Error(self):
|
1673
|
-
"""Error() str"""
|
1674
|
-
return _api.api_VMError_Error(self.handle)
|
1675
|
-
def Unwrap(self):
|
1676
|
-
"""Unwrap() str"""
|
1677
|
-
return _api.api_VMError_Unwrap(self.handle)
|
1678
|
-
def IsCompileError(self):
|
1679
|
-
"""IsCompileError() bool
|
1680
|
-
|
1681
|
-
IsCompileError returns true if the error is a compilation error
|
1682
|
-
"""
|
1683
|
-
return _api.api_VMError_IsCompileError(self.handle)
|
1684
|
-
def IsRuntimeError(self):
|
1685
|
-
"""IsRuntimeError() bool
|
1686
|
-
|
1687
|
-
IsRuntimeError returns true if the error is a runtime error
|
1688
|
-
"""
|
1689
|
-
return _api.api_VMError_IsRuntimeError(self.handle)
|
1690
|
-
def IsTimeoutError(self):
|
1691
|
-
"""IsTimeoutError() bool
|
1692
|
-
|
1693
|
-
IsTimeoutError returns true if the error is a timeout error
|
1694
|
-
"""
|
1695
|
-
return _api.api_VMError_IsTimeoutError(self.handle)
|
1696
|
-
def IsConversionError(self):
|
1697
|
-
"""IsConversionError() bool
|
1698
|
-
|
1699
|
-
IsConversionError returns true if the error is a type conversion error
|
1700
|
-
"""
|
1701
|
-
return _api.api_VMError_IsConversionError(self.handle)
|
1702
|
-
def IsConfigError(self):
|
1703
|
-
"""IsConfigError() bool
|
1704
|
-
|
1705
|
-
IsConfigError returns true if the error is a configuration error
|
1706
|
-
"""
|
1707
|
-
return _api.api_VMError_IsConfigError(self.handle)
|
1707
|
+
_api.api_SourceLocation_Column_Set(self.handle, value)
|
1708
1708
|
|
1709
1709
|
|
1710
1710
|
# ---- Slices ---
|
@@ -1714,84 +1714,78 @@ class VMError(go.GoClass):
|
|
1714
1714
|
|
1715
1715
|
|
1716
1716
|
# ---- Constructors ---
|
1717
|
-
def WrapAny(value):
|
1718
|
-
"""WrapAny(str value) object"""
|
1719
|
-
return GoValue(handle=_api.api_WrapAny(value))
|
1720
|
-
def WrapBool(value):
|
1721
|
-
"""WrapBool(bool value) object"""
|
1722
|
-
return GoValue(handle=_api.api_WrapBool(value))
|
1723
|
-
def WrapObject(value):
|
1724
|
-
"""WrapObject(object value) object"""
|
1725
|
-
return GoValue(handle=_api.api_WrapObject(value.handle))
|
1726
|
-
def ToGoValue(val):
|
1727
|
-
"""ToGoValue(object val) object, str
|
1728
|
-
|
1729
|
-
ToGoValue converts an Objective-LOL value to a Go value
|
1730
|
-
"""
|
1731
|
-
return GoValue(handle=_api.api_ToGoValue(val.handle))
|
1732
|
-
def WrapFloat(value):
|
1733
|
-
"""WrapFloat(float value) object"""
|
1734
|
-
return GoValue(handle=_api.api_WrapFloat(value))
|
1735
|
-
def WrapInt(value):
|
1736
|
-
"""WrapInt(long value) object"""
|
1737
|
-
return GoValue(handle=_api.api_WrapInt(value))
|
1738
|
-
def WrapString(value):
|
1739
|
-
"""WrapString(str value) object"""
|
1740
|
-
return GoValue(handle=_api.api_WrapString(value))
|
1741
|
-
def NewVM(config):
|
1742
|
-
"""NewVM(object config) object, str
|
1743
|
-
|
1744
|
-
NewVM creates a new VM instance with the given config
|
1745
|
-
"""
|
1746
|
-
return VM(handle=_api.api_NewVM(config.handle))
|
1747
|
-
def NewClassDefinition():
|
1748
|
-
"""NewClassDefinition() object"""
|
1749
|
-
return ClassDefinition(handle=_api.api_NewClassDefinition())
|
1750
1717
|
def DefaultConfig():
|
1751
1718
|
"""DefaultConfig() object
|
1752
1719
|
|
1753
1720
|
DefaultConfig returns a default configuration
|
1754
1721
|
"""
|
1755
1722
|
return VMConfig(handle=_api.api_DefaultConfig())
|
1756
|
-
def NewConversionError(message, wrapped):
|
1757
|
-
"""NewConversionError(str message, str wrapped) object
|
1758
|
-
|
1759
|
-
NewConversionError creates a new type conversion error
|
1760
|
-
"""
|
1761
|
-
return VMError(handle=_api.api_NewConversionError(message, wrapped))
|
1762
1723
|
def NewCompileError(message, source):
|
1763
1724
|
"""NewCompileError(str message, object source) object
|
1764
1725
|
|
1765
1726
|
NewCompileError creates a new compile error
|
1766
1727
|
"""
|
1767
1728
|
return VMError(handle=_api.api_NewCompileError(message, source.handle))
|
1768
|
-
def
|
1769
|
-
"""
|
1729
|
+
def NewRuntimeError(message, source):
|
1730
|
+
"""NewRuntimeError(str message, object source) object
|
1770
1731
|
|
1771
|
-
|
1732
|
+
NewRuntimeError creates a new runtime error
|
1772
1733
|
"""
|
1773
|
-
return VMError(handle=_api.
|
1734
|
+
return VMError(handle=_api.api_NewRuntimeError(message, source.handle))
|
1774
1735
|
def NewTimeoutError(duration):
|
1775
1736
|
"""NewTimeoutError(long duration) object
|
1776
1737
|
|
1777
1738
|
NewTimeoutError creates a new timeout error
|
1778
1739
|
"""
|
1779
1740
|
return VMError(handle=_api.api_NewTimeoutError(duration))
|
1780
|
-
def
|
1781
|
-
"""
|
1741
|
+
def NewConfigError(message, wrapped):
|
1742
|
+
"""NewConfigError(str message, str wrapped) object
|
1782
1743
|
|
1783
|
-
|
1744
|
+
NewConfigError creates a new configuration error
|
1784
1745
|
"""
|
1785
|
-
return VMError(handle=_api.
|
1746
|
+
return VMError(handle=_api.api_NewConfigError(message, wrapped))
|
1747
|
+
def NewConversionError(message, wrapped):
|
1748
|
+
"""NewConversionError(str message, str wrapped) object
|
1749
|
+
|
1750
|
+
NewConversionError creates a new type conversion error
|
1751
|
+
"""
|
1752
|
+
return VMError(handle=_api.api_NewConversionError(message, wrapped))
|
1753
|
+
def NewVM(config):
|
1754
|
+
"""NewVM(object config) object, str
|
1755
|
+
|
1756
|
+
NewVM creates a new VM instance with the given config
|
1757
|
+
"""
|
1758
|
+
return VM(handle=_api.api_NewVM(config.handle))
|
1759
|
+
def NewClassDefinition():
|
1760
|
+
"""NewClassDefinition() object"""
|
1761
|
+
return ClassDefinition(handle=_api.api_NewClassDefinition())
|
1762
|
+
def WrapInt(value):
|
1763
|
+
"""WrapInt(long value) object"""
|
1764
|
+
return GoValue(handle=_api.api_WrapInt(value))
|
1765
|
+
def WrapBool(value):
|
1766
|
+
"""WrapBool(bool value) object"""
|
1767
|
+
return GoValue(handle=_api.api_WrapBool(value))
|
1768
|
+
def WrapFloat(value):
|
1769
|
+
"""WrapFloat(float value) object"""
|
1770
|
+
return GoValue(handle=_api.api_WrapFloat(value))
|
1771
|
+
def ToGoValue(val):
|
1772
|
+
"""ToGoValue(object val) object, str
|
1773
|
+
|
1774
|
+
ToGoValue converts an Objective-LOL value to a Go value
|
1775
|
+
"""
|
1776
|
+
return GoValue(handle=_api.api_ToGoValue(val.handle))
|
1777
|
+
def WrapString(value):
|
1778
|
+
"""WrapString(str value) object"""
|
1779
|
+
return GoValue(handle=_api.api_WrapString(value))
|
1780
|
+
def WrapAny(value):
|
1781
|
+
"""WrapAny(str value) object"""
|
1782
|
+
return GoValue(handle=_api.api_WrapAny(value))
|
1783
|
+
def WrapObject(value):
|
1784
|
+
"""WrapObject(object value) object"""
|
1785
|
+
return GoValue(handle=_api.api_WrapObject(value.handle))
|
1786
1786
|
|
1787
1787
|
|
1788
1788
|
# ---- Functions ---
|
1789
|
-
def FromGoValue(val):
|
1790
|
-
"""FromGoValue(object val) object, str
|
1791
|
-
|
1792
|
-
FromGoValue converts a Go value to an Objective-LOL value
|
1793
|
-
"""
|
1794
|
-
return go.environment_Value(handle=_api.api_FromGoValue(val.handle))
|
1795
1789
|
def LookupObject(id):
|
1796
1790
|
"""LookupObject(str id) object, str"""
|
1797
1791
|
return go.Ptr_environment_ObjectInstance(handle=_api.api_LookupObject(id))
|
@@ -1801,5 +1795,11 @@ def ConvertArguments(args):
|
|
1801
1795
|
ConvertArguments converts a slice of Go values to Objective-LOL values
|
1802
1796
|
"""
|
1803
1797
|
return Slice_environment_Value(handle=_api.api_ConvertArguments(args.handle))
|
1798
|
+
def FromGoValue(val):
|
1799
|
+
"""FromGoValue(object val) object, str
|
1800
|
+
|
1801
|
+
FromGoValue converts a Go value to an Objective-LOL value
|
1802
|
+
"""
|
1803
|
+
return go.environment_Value(handle=_api.api_FromGoValue(val.handle))
|
1804
1804
|
|
1805
1805
|
|