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