objective-lol 0.0.1__cp311-cp311-win_amd64.whl → 0.0.2__cp311-cp311-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.py CHANGED
@@ -741,6 +741,114 @@ TimeoutErrorType = "timeout"
741
741
 
742
742
  # ---- Structs ---
743
743
 
744
+ # Python type for struct api.UnknownFunctionHandler
745
+ class UnknownFunctionHandler(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_UnknownFunctionHandler_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.UnknownFunctionHandler{'
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.UnknownFunctionHandler ( '
780
+ for v in pr:
781
+ if not callable(v[1]):
782
+ sv += v[0] + '=' + str(v[1]) + ', '
783
+ return sv + ')'
784
+
785
+ # Python type for struct api.ClassMethod
786
+ class ClassMethod(go.GoClass):
787
+ """"""
788
+ def __init__(self, *args, **kwargs):
789
+ """
790
+ handle=A Go-side object is always initialized with an explicit handle=arg
791
+ otherwise parameters can be unnamed in order of field names or named fields
792
+ in which case a new Go object is constructed first
793
+ """
794
+ if len(kwargs) == 1 and 'handle' in kwargs:
795
+ self.handle = kwargs['handle']
796
+ _api.IncRef(self.handle)
797
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
798
+ self.handle = args[0].handle
799
+ _api.IncRef(self.handle)
800
+ else:
801
+ self.handle = _api.api_ClassMethod_CTor()
802
+ _api.IncRef(self.handle)
803
+ if 0 < len(args):
804
+ self.Name = args[0]
805
+ if "Name" in kwargs:
806
+ self.Name = kwargs["Name"]
807
+ if 1 < len(args):
808
+ self.Argc = args[1]
809
+ if "Argc" in kwargs:
810
+ self.Argc = kwargs["Argc"]
811
+ def __del__(self):
812
+ _api.DecRef(self.handle)
813
+ def __str__(self):
814
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
815
+ sv = 'api.ClassMethod{'
816
+ first = True
817
+ for v in pr:
818
+ if callable(v[1]):
819
+ continue
820
+ if first:
821
+ first = False
822
+ else:
823
+ sv += ', '
824
+ sv += v[0] + '=' + str(v[1])
825
+ return sv + '}'
826
+ def __repr__(self):
827
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
828
+ sv = 'api.ClassMethod ( '
829
+ for v in pr:
830
+ if not callable(v[1]):
831
+ sv += v[0] + '=' + str(v[1]) + ', '
832
+ return sv + ')'
833
+ @property
834
+ def Name(self):
835
+ return _api.api_ClassMethod_Name_Get(self.handle)
836
+ @Name.setter
837
+ def Name(self, value):
838
+ if isinstance(value, go.GoClass):
839
+ _api.api_ClassMethod_Name_Set(self.handle, value.handle)
840
+ else:
841
+ _api.api_ClassMethod_Name_Set(self.handle, value)
842
+ @property
843
+ def Argc(self):
844
+ return _api.api_ClassMethod_Argc_Get(self.handle)
845
+ @Argc.setter
846
+ def Argc(self, value):
847
+ if isinstance(value, go.GoClass):
848
+ _api.api_ClassMethod_Argc_Set(self.handle, value.handle)
849
+ else:
850
+ _api.api_ClassMethod_Argc_Set(self.handle, value)
851
+
744
852
  # Python type for struct api.SourceLocation
745
853
  class SourceLocation(go.GoClass):
746
854
  """SourceLocation represents a location in source code\n"""
@@ -821,9 +929,9 @@ class SourceLocation(go.GoClass):
821
929
  else:
822
930
  _api.api_SourceLocation_Column_Set(self.handle, value)
823
931
 
824
- # Python type for struct api.VM
825
- class VM(go.GoClass):
826
- """VM represents an Objective-LOL virtual machine instance\n"""
932
+ # Python type for struct api.ExecutionResult
933
+ class ExecutionResult(go.GoClass):
934
+ """ExecutionResult represents the result of executing Objective-LOL code\n"""
827
935
  def __init__(self, *args, **kwargs):
828
936
  """
829
937
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -837,13 +945,25 @@ class VM(go.GoClass):
837
945
  self.handle = args[0].handle
838
946
  _api.IncRef(self.handle)
839
947
  else:
840
- self.handle = _api.api_VM_CTor()
948
+ self.handle = _api.api_ExecutionResult_CTor()
841
949
  _api.IncRef(self.handle)
950
+ if 0 < len(args):
951
+ self.Value = args[0]
952
+ if "Value" in kwargs:
953
+ self.Value = kwargs["Value"]
954
+ if 1 < len(args):
955
+ self.RawValue = args[1]
956
+ if "RawValue" in kwargs:
957
+ self.RawValue = kwargs["RawValue"]
958
+ if 2 < len(args):
959
+ self.Output = args[2]
960
+ if "Output" in kwargs:
961
+ self.Output = kwargs["Output"]
842
962
  def __del__(self):
843
963
  _api.DecRef(self.handle)
844
964
  def __str__(self):
845
965
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
846
- sv = 'api.VM{'
966
+ sv = 'api.ExecutionResult{'
847
967
  first = True
848
968
  for v in pr:
849
969
  if callable(v[1]):
@@ -856,69 +976,48 @@ class VM(go.GoClass):
856
976
  return sv + '}'
857
977
  def __repr__(self):
858
978
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
859
- sv = 'api.VM ( '
979
+ sv = 'api.ExecutionResult ( '
860
980
  for v in pr:
861
981
  if not callable(v[1]):
862
982
  sv += v[0] + '=' + str(v[1]) + ', '
863
983
  return sv + ')'
864
- def GetCompatibilityShim(self):
865
- """GetCompatibilityShim() object
866
-
867
- GetCompatibilityShim returns a compatibility shim for the VM
868
- """
869
- return VMCompatibilityShim(handle=_api.api_VM_GetCompatibilityShim(self.handle))
870
- def Execute(self, code):
871
- """Execute(str code) object, str
872
-
873
- Execute executes Objective-LOL code from a string
874
- """
875
- return ExecutionResult(handle=_api.api_VM_Execute(self.handle, code))
876
- def ExecuteWithContext(self, ctx, code):
877
- """ExecuteWithContext(object ctx, str code) object, str
878
-
879
- ExecuteWithContext executes code with a context for cancellation/timeout
880
- """
881
- return ExecutionResult(handle=_api.api_VM_ExecuteWithContext(self.handle, ctx.handle, code))
882
- def NewObjectInstance(self, className):
883
- """NewObjectInstance(str className) object, str"""
884
- return GoValue(handle=_api.api_VM_NewObjectInstance(self.handle, className))
885
- def Call(self, functionName, args):
886
- """Call(str functionName, []object args) object, str
887
-
888
- Call calls an Objective-LOL function with the given arguments
889
- """
890
- return GoValue(handle=_api.api_VM_Call(self.handle, functionName, args.handle))
891
- def CallMethod(self, object, methodName, args):
892
- """CallMethod(object object, str methodName, []object args) object, str
893
-
894
- CallMethod calls a method on an Objective-LOL object
895
- """
896
- return GoValue(handle=_api.api_VM_CallMethod(self.handle, object.handle, methodName, args.handle))
897
- def DefineVariable(self, name, value, constant):
898
- """DefineVariable(str name, object value, bool constant) str
899
-
900
- DefineVariable defines a global variable in the VM
984
+ @property
985
+ def Value(self):
986
+ """Return value from the execution (e.g., from MAIN function)
901
987
  """
902
- return _api.api_VM_DefineVariable(self.handle, name, value.handle, constant)
903
- def SetVariable(self, variableName, value):
904
- """SetVariable(str variableName, object value) str
905
-
906
- SetVariable sets a variable in the global environment
988
+ return GoValue(handle=_api.api_ExecutionResult_Value_Get(self.handle))
989
+ @Value.setter
990
+ def Value(self, value):
991
+ if isinstance(value, go.GoClass):
992
+ _api.api_ExecutionResult_Value_Set(self.handle, value.handle)
993
+ else:
994
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
995
+ @property
996
+ def RawValue(self):
997
+ """Raw Objective-LOL value (for advanced use)
907
998
  """
908
- return _api.api_VM_SetVariable(self.handle, variableName, value.handle)
909
- def GetVariable(self, variableName):
910
- """GetVariable(str variableName) object, str
911
-
912
- Get gets a variable from the global environment
999
+ return go.environment_Value(handle=_api.api_ExecutionResult_RawValue_Get(self.handle))
1000
+ @RawValue.setter
1001
+ def RawValue(self, value):
1002
+ if isinstance(value, go.GoClass):
1003
+ _api.api_ExecutionResult_RawValue_Set(self.handle, value.handle)
1004
+ else:
1005
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1006
+ @property
1007
+ def Output(self):
1008
+ """Output captured during execution (if configured)
913
1009
  """
914
- return GoValue(handle=_api.api_VM_GetVariable(self.handle, variableName))
915
- def DefineClass(self, classDef):
916
- """DefineClass(object classDef) str"""
917
- return _api.api_VM_DefineClass(self.handle, classDef.handle)
1010
+ return _api.api_ExecutionResult_Output_Get(self.handle)
1011
+ @Output.setter
1012
+ def Output(self, value):
1013
+ if isinstance(value, go.GoClass):
1014
+ _api.api_ExecutionResult_Output_Set(self.handle, value.handle)
1015
+ else:
1016
+ _api.api_ExecutionResult_Output_Set(self.handle, value)
918
1017
 
919
- # Python type for struct api.VMCompatibilityShim
920
- class VMCompatibilityShim(go.GoClass):
921
- """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"""
1018
+ # Python type for struct api.GoValue
1019
+ class GoValue(go.GoClass):
1020
+ """"""
922
1021
  def __init__(self, *args, **kwargs):
923
1022
  """
924
1023
  handle=A Go-side object is always initialized with an explicit handle=arg
@@ -932,13 +1031,13 @@ class VMCompatibilityShim(go.GoClass):
932
1031
  self.handle = args[0].handle
933
1032
  _api.IncRef(self.handle)
934
1033
  else:
935
- self.handle = _api.api_VMCompatibilityShim_CTor()
1034
+ self.handle = _api.api_GoValue_CTor()
936
1035
  _api.IncRef(self.handle)
937
1036
  def __del__(self):
938
1037
  _api.DecRef(self.handle)
939
1038
  def __str__(self):
940
1039
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
941
- sv = 'api.VMCompatibilityShim{'
1040
+ sv = 'api.GoValue{'
942
1041
  first = True
943
1042
  for v in pr:
944
1043
  if callable(v[1]):
@@ -951,42 +1050,208 @@ class VMCompatibilityShim(go.GoClass):
951
1050
  return sv + '}'
952
1051
  def __repr__(self):
953
1052
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
954
- sv = 'api.VMCompatibilityShim ( '
1053
+ sv = 'api.GoValue ( '
955
1054
  for v in pr:
956
1055
  if not callable(v[1]):
957
1056
  sv += v[0] + '=' + str(v[1]) + ', '
958
1057
  return sv + ')'
959
- def DefineFunction(self, id, name, argc, function):
960
- """DefineFunction(str id, str name, int argc, callable function) str
961
-
962
- DefineFunction defines a global function with maximum compatibility,
963
- wrapping arguments and return values as JSON strings.
964
- An optional id cookie is passed back to the function to identify it.
965
- jsonArgs is a JSON array string of the arguments.
966
- The function should return a JSON object string with "result" and "error" fields.
967
- """
968
- return _api.api_VMCompatibilityShim_DefineFunction(self.handle, id, name, argc, function)
969
- def BuildNewClassVariableWithGetter(self, variable, getterID, getter):
970
- """BuildNewClassVariableWithGetter(object variable, str getterID, callable getter) object"""
971
- return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithGetter(self.handle, variable.handle, getterID, getter))
972
- def BuildNewClassVariableWithSetter(self, variable, setterID, setter):
973
- """BuildNewClassVariableWithSetter(object variable, str setterID, callable setter) object"""
974
- return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithSetter(self.handle, variable.handle, setterID, setter))
975
- def BuildNewClassMethod(self, method, id, function):
976
- """BuildNewClassMethod(object method, str id, callable function) object"""
977
- return ClassMethod(handle=_api.api_VMCompatibilityShim_BuildNewClassMethod(self.handle, method.handle, id, function))
978
- def BuildNewUnknownFunctionHandler(self, id, function):
979
- """BuildNewUnknownFunctionHandler(str id, callable function) object"""
980
- return UnknownFunctionHandler(handle=_api.api_VMCompatibilityShim_BuildNewUnknownFunctionHandler(self.handle, id, function))
981
- def IsClassDefined(self, name):
982
- """IsClassDefined(str name) bool"""
983
- return _api.api_VMCompatibilityShim_IsClassDefined(self.handle, name)
984
- def LookupObject(self, id):
985
- """LookupObject(str id) object, str"""
986
- return GoValue(handle=_api.api_VMCompatibilityShim_LookupObject(self.handle, id))
987
- def GetObjectMRO(self, id):
988
- """GetObjectMRO(str id) []str, str"""
989
- return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectMRO(self.handle, id))
1058
+ def ID(self):
1059
+ """ID() str"""
1060
+ return _api.api_GoValue_ID(self.handle)
1061
+ def MarshalJSON(self):
1062
+ """MarshalJSON() []int, str"""
1063
+ return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
1064
+ def Type(self):
1065
+ """Type() str"""
1066
+ return _api.api_GoValue_Type(self.handle)
1067
+ def Int(self):
1068
+ """Int() long, str"""
1069
+ return _api.api_GoValue_Int(self.handle)
1070
+ def Float(self):
1071
+ """Float() float, str"""
1072
+ return _api.api_GoValue_Float(self.handle)
1073
+ def String(self):
1074
+ """String() str, str"""
1075
+ return _api.api_GoValue_String(self.handle)
1076
+ def Bool(self):
1077
+ """Bool() bool, str"""
1078
+ return _api.api_GoValue_Bool(self.handle)
1079
+ def Slice(self):
1080
+ """Slice() []object, str"""
1081
+ return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
1082
+ def Map(self):
1083
+ """Map() object, str"""
1084
+ return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
1085
+ def Object(self):
1086
+ """Object() object, str"""
1087
+ return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
1088
+
1089
+ # Python type for struct api.VM
1090
+ class VM(go.GoClass):
1091
+ """VM represents an Objective-LOL virtual machine instance\n"""
1092
+ def __init__(self, *args, **kwargs):
1093
+ """
1094
+ handle=A Go-side object is always initialized with an explicit handle=arg
1095
+ otherwise parameters can be unnamed in order of field names or named fields
1096
+ in which case a new Go object is constructed first
1097
+ """
1098
+ if len(kwargs) == 1 and 'handle' in kwargs:
1099
+ self.handle = kwargs['handle']
1100
+ _api.IncRef(self.handle)
1101
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1102
+ self.handle = args[0].handle
1103
+ _api.IncRef(self.handle)
1104
+ else:
1105
+ self.handle = _api.api_VM_CTor()
1106
+ _api.IncRef(self.handle)
1107
+ def __del__(self):
1108
+ _api.DecRef(self.handle)
1109
+ def __str__(self):
1110
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1111
+ sv = 'api.VM{'
1112
+ first = True
1113
+ for v in pr:
1114
+ if callable(v[1]):
1115
+ continue
1116
+ if first:
1117
+ first = False
1118
+ else:
1119
+ sv += ', '
1120
+ sv += v[0] + '=' + str(v[1])
1121
+ return sv + '}'
1122
+ def __repr__(self):
1123
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1124
+ sv = 'api.VM ( '
1125
+ for v in pr:
1126
+ if not callable(v[1]):
1127
+ sv += v[0] + '=' + str(v[1]) + ', '
1128
+ return sv + ')'
1129
+ def GetCompatibilityShim(self):
1130
+ """GetCompatibilityShim() object
1131
+
1132
+ GetCompatibilityShim returns a compatibility shim for the VM
1133
+ """
1134
+ return VMCompatibilityShim(handle=_api.api_VM_GetCompatibilityShim(self.handle))
1135
+ def Execute(self, code):
1136
+ """Execute(str code) object, str
1137
+
1138
+ Execute executes Objective-LOL code from a string
1139
+ """
1140
+ return ExecutionResult(handle=_api.api_VM_Execute(self.handle, code))
1141
+ def ExecuteWithContext(self, ctx, code):
1142
+ """ExecuteWithContext(object ctx, str code) object, str
1143
+
1144
+ ExecuteWithContext executes code with a context for cancellation/timeout
1145
+ """
1146
+ return ExecutionResult(handle=_api.api_VM_ExecuteWithContext(self.handle, ctx.handle, code))
1147
+ def NewObjectInstance(self, className):
1148
+ """NewObjectInstance(str className) object, str"""
1149
+ return GoValue(handle=_api.api_VM_NewObjectInstance(self.handle, className))
1150
+ def Call(self, functionName, args):
1151
+ """Call(str functionName, []object args) object, str
1152
+
1153
+ Call calls an Objective-LOL function with the given arguments
1154
+ """
1155
+ return GoValue(handle=_api.api_VM_Call(self.handle, functionName, args.handle))
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)
1183
+
1184
+ # Python type for struct api.VMCompatibilityShim
1185
+ class VMCompatibilityShim(go.GoClass):
1186
+ """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"""
1187
+ def __init__(self, *args, **kwargs):
1188
+ """
1189
+ handle=A Go-side object is always initialized with an explicit handle=arg
1190
+ otherwise parameters can be unnamed in order of field names or named fields
1191
+ in which case a new Go object is constructed first
1192
+ """
1193
+ if len(kwargs) == 1 and 'handle' in kwargs:
1194
+ self.handle = kwargs['handle']
1195
+ _api.IncRef(self.handle)
1196
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1197
+ self.handle = args[0].handle
1198
+ _api.IncRef(self.handle)
1199
+ else:
1200
+ self.handle = _api.api_VMCompatibilityShim_CTor()
1201
+ _api.IncRef(self.handle)
1202
+ def __del__(self):
1203
+ _api.DecRef(self.handle)
1204
+ def __str__(self):
1205
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1206
+ sv = 'api.VMCompatibilityShim{'
1207
+ first = True
1208
+ for v in pr:
1209
+ if callable(v[1]):
1210
+ continue
1211
+ if first:
1212
+ first = False
1213
+ else:
1214
+ sv += ', '
1215
+ sv += v[0] + '=' + str(v[1])
1216
+ return sv + '}'
1217
+ def __repr__(self):
1218
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1219
+ sv = 'api.VMCompatibilityShim ( '
1220
+ for v in pr:
1221
+ if not callable(v[1]):
1222
+ sv += v[0] + '=' + str(v[1]) + ', '
1223
+ return sv + ')'
1224
+ def DefineFunction(self, id, name, argc, function):
1225
+ """DefineFunction(str id, str name, int argc, callable function) str
1226
+
1227
+ DefineFunction defines a global function with maximum compatibility,
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.
1232
+ """
1233
+ return _api.api_VMCompatibilityShim_DefineFunction(self.handle, id, name, argc, function)
1234
+ def BuildNewClassVariableWithGetter(self, variable, getterID, getter):
1235
+ """BuildNewClassVariableWithGetter(object variable, str getterID, callable getter) object"""
1236
+ return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithGetter(self.handle, variable.handle, getterID, getter))
1237
+ def BuildNewClassVariableWithSetter(self, variable, setterID, setter):
1238
+ """BuildNewClassVariableWithSetter(object variable, str setterID, callable setter) object"""
1239
+ return ClassVariable(handle=_api.api_VMCompatibilityShim_BuildNewClassVariableWithSetter(self.handle, variable.handle, setterID, setter))
1240
+ def BuildNewClassMethod(self, method, id, function):
1241
+ """BuildNewClassMethod(object method, str id, callable function) object"""
1242
+ return ClassMethod(handle=_api.api_VMCompatibilityShim_BuildNewClassMethod(self.handle, method.handle, id, function))
1243
+ def BuildNewUnknownFunctionHandler(self, id, function):
1244
+ """BuildNewUnknownFunctionHandler(str id, callable function) object"""
1245
+ return UnknownFunctionHandler(handle=_api.api_VMCompatibilityShim_BuildNewUnknownFunctionHandler(self.handle, id, function))
1246
+ def IsClassDefined(self, name):
1247
+ """IsClassDefined(str name) bool"""
1248
+ return _api.api_VMCompatibilityShim_IsClassDefined(self.handle, name)
1249
+ def LookupObject(self, id):
1250
+ """LookupObject(str id) object, str"""
1251
+ return GoValue(handle=_api.api_VMCompatibilityShim_LookupObject(self.handle, id))
1252
+ def GetObjectMRO(self, id):
1253
+ """GetObjectMRO(str id) []str, str"""
1254
+ return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectMRO(self.handle, id))
990
1255
  def GetObjectImmediateFunctions(self, id):
991
1256
  """GetObjectImmediateFunctions(str id) []str, str"""
992
1257
  return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateFunctions(self.handle, id))
@@ -1361,8 +1626,8 @@ class ClassDefinition(go.GoClass):
1361
1626
  else:
1362
1627
  raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1363
1628
 
1364
- # Python type for struct api.ClassMethod
1365
- class ClassMethod(go.GoClass):
1629
+ # Python type for struct api.ClassVariable
1630
+ class ClassVariable(go.GoClass):
1366
1631
  """"""
1367
1632
  def __init__(self, *args, **kwargs):
1368
1633
  """
@@ -1377,21 +1642,25 @@ class ClassMethod(go.GoClass):
1377
1642
  self.handle = args[0].handle
1378
1643
  _api.IncRef(self.handle)
1379
1644
  else:
1380
- self.handle = _api.api_ClassMethod_CTor()
1645
+ self.handle = _api.api_ClassVariable_CTor()
1381
1646
  _api.IncRef(self.handle)
1382
1647
  if 0 < len(args):
1383
1648
  self.Name = args[0]
1384
1649
  if "Name" in kwargs:
1385
1650
  self.Name = kwargs["Name"]
1386
1651
  if 1 < len(args):
1387
- self.Argc = args[1]
1388
- if "Argc" in kwargs:
1389
- self.Argc = kwargs["Argc"]
1652
+ self.Value = args[1]
1653
+ if "Value" in kwargs:
1654
+ self.Value = kwargs["Value"]
1655
+ if 2 < len(args):
1656
+ self.Locked = args[2]
1657
+ if "Locked" in kwargs:
1658
+ self.Locked = kwargs["Locked"]
1390
1659
  def __del__(self):
1391
1660
  _api.DecRef(self.handle)
1392
1661
  def __str__(self):
1393
1662
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1394
- sv = 'api.ClassMethod{'
1663
+ sv = 'api.ClassVariable{'
1395
1664
  first = True
1396
1665
  for v in pr:
1397
1666
  if callable(v[1]):
@@ -1404,307 +1673,38 @@ class ClassMethod(go.GoClass):
1404
1673
  return sv + '}'
1405
1674
  def __repr__(self):
1406
1675
  pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1407
- sv = 'api.ClassMethod ( '
1676
+ sv = 'api.ClassVariable ( '
1408
1677
  for v in pr:
1409
1678
  if not callable(v[1]):
1410
1679
  sv += v[0] + '=' + str(v[1]) + ', '
1411
1680
  return sv + ')'
1412
1681
  @property
1413
1682
  def Name(self):
1414
- return _api.api_ClassMethod_Name_Get(self.handle)
1683
+ return _api.api_ClassVariable_Name_Get(self.handle)
1415
1684
  @Name.setter
1416
1685
  def Name(self, value):
1417
1686
  if isinstance(value, go.GoClass):
1418
- _api.api_ClassMethod_Name_Set(self.handle, value.handle)
1687
+ _api.api_ClassVariable_Name_Set(self.handle, value.handle)
1419
1688
  else:
1420
- _api.api_ClassMethod_Name_Set(self.handle, value)
1689
+ _api.api_ClassVariable_Name_Set(self.handle, value)
1421
1690
  @property
1422
- def Argc(self):
1423
- return _api.api_ClassMethod_Argc_Get(self.handle)
1424
- @Argc.setter
1425
- def Argc(self, value):
1691
+ def Value(self):
1692
+ return GoValue(handle=_api.api_ClassVariable_Value_Get(self.handle))
1693
+ @Value.setter
1694
+ def Value(self, value):
1426
1695
  if isinstance(value, go.GoClass):
1427
- _api.api_ClassMethod_Argc_Set(self.handle, value.handle)
1696
+ _api.api_ClassVariable_Value_Set(self.handle, value.handle)
1428
1697
  else:
1429
- _api.api_ClassMethod_Argc_Set(self.handle, value)
1430
-
1431
- # Python type for struct api.ClassVariable
1432
- class ClassVariable(go.GoClass):
1433
- """"""
1434
- def __init__(self, *args, **kwargs):
1435
- """
1436
- handle=A Go-side object is always initialized with an explicit handle=arg
1437
- otherwise parameters can be unnamed in order of field names or named fields
1438
- in which case a new Go object is constructed first
1439
- """
1440
- if len(kwargs) == 1 and 'handle' in kwargs:
1441
- self.handle = kwargs['handle']
1442
- _api.IncRef(self.handle)
1443
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1444
- self.handle = args[0].handle
1445
- _api.IncRef(self.handle)
1446
- else:
1447
- self.handle = _api.api_ClassVariable_CTor()
1448
- _api.IncRef(self.handle)
1449
- if 0 < len(args):
1450
- self.Name = args[0]
1451
- if "Name" in kwargs:
1452
- self.Name = kwargs["Name"]
1453
- if 1 < len(args):
1454
- self.Value = args[1]
1455
- if "Value" in kwargs:
1456
- self.Value = kwargs["Value"]
1457
- if 2 < len(args):
1458
- self.Locked = args[2]
1459
- if "Locked" in kwargs:
1460
- self.Locked = kwargs["Locked"]
1461
- def __del__(self):
1462
- _api.DecRef(self.handle)
1463
- def __str__(self):
1464
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1465
- sv = 'api.ClassVariable{'
1466
- first = True
1467
- for v in pr:
1468
- if callable(v[1]):
1469
- continue
1470
- if first:
1471
- first = False
1472
- else:
1473
- sv += ', '
1474
- sv += v[0] + '=' + str(v[1])
1475
- return sv + '}'
1476
- def __repr__(self):
1477
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1478
- sv = 'api.ClassVariable ( '
1479
- for v in pr:
1480
- if not callable(v[1]):
1481
- sv += v[0] + '=' + str(v[1]) + ', '
1482
- return sv + ')'
1483
- @property
1484
- def Name(self):
1485
- return _api.api_ClassVariable_Name_Get(self.handle)
1486
- @Name.setter
1487
- def Name(self, value):
1488
- if isinstance(value, go.GoClass):
1489
- _api.api_ClassVariable_Name_Set(self.handle, value.handle)
1490
- else:
1491
- _api.api_ClassVariable_Name_Set(self.handle, value)
1492
- @property
1493
- def Value(self):
1494
- return GoValue(handle=_api.api_ClassVariable_Value_Get(self.handle))
1495
- @Value.setter
1496
- def Value(self, value):
1497
- if isinstance(value, go.GoClass):
1498
- _api.api_ClassVariable_Value_Set(self.handle, value.handle)
1499
- else:
1500
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1501
- @property
1502
- def Locked(self):
1503
- return _api.api_ClassVariable_Locked_Get(self.handle)
1504
- @Locked.setter
1505
- def Locked(self, value):
1506
- if isinstance(value, go.GoClass):
1507
- _api.api_ClassVariable_Locked_Set(self.handle, value.handle)
1508
- else:
1509
- _api.api_ClassVariable_Locked_Set(self.handle, value)
1510
-
1511
- # Python type for struct api.ExecutionResult
1512
- class ExecutionResult(go.GoClass):
1513
- """ExecutionResult represents the result of executing Objective-LOL code\n"""
1514
- def __init__(self, *args, **kwargs):
1515
- """
1516
- handle=A Go-side object is always initialized with an explicit handle=arg
1517
- otherwise parameters can be unnamed in order of field names or named fields
1518
- in which case a new Go object is constructed first
1519
- """
1520
- if len(kwargs) == 1 and 'handle' in kwargs:
1521
- self.handle = kwargs['handle']
1522
- _api.IncRef(self.handle)
1523
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1524
- self.handle = args[0].handle
1525
- _api.IncRef(self.handle)
1526
- else:
1527
- self.handle = _api.api_ExecutionResult_CTor()
1528
- _api.IncRef(self.handle)
1529
- if 0 < len(args):
1530
- self.Value = args[0]
1531
- if "Value" in kwargs:
1532
- self.Value = kwargs["Value"]
1533
- if 1 < len(args):
1534
- self.RawValue = args[1]
1535
- if "RawValue" in kwargs:
1536
- self.RawValue = kwargs["RawValue"]
1537
- if 2 < len(args):
1538
- self.Output = args[2]
1539
- if "Output" in kwargs:
1540
- self.Output = kwargs["Output"]
1541
- def __del__(self):
1542
- _api.DecRef(self.handle)
1543
- def __str__(self):
1544
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1545
- sv = 'api.ExecutionResult{'
1546
- first = True
1547
- for v in pr:
1548
- if callable(v[1]):
1549
- continue
1550
- if first:
1551
- first = False
1552
- else:
1553
- sv += ', '
1554
- sv += v[0] + '=' + str(v[1])
1555
- return sv + '}'
1556
- def __repr__(self):
1557
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1558
- sv = 'api.ExecutionResult ( '
1559
- for v in pr:
1560
- if not callable(v[1]):
1561
- sv += v[0] + '=' + str(v[1]) + ', '
1562
- return sv + ')'
1563
- @property
1564
- def Value(self):
1565
- """Return value from the execution (e.g., from MAIN function)
1566
- """
1567
- return GoValue(handle=_api.api_ExecutionResult_Value_Get(self.handle))
1568
- @Value.setter
1569
- def Value(self, value):
1570
- if isinstance(value, go.GoClass):
1571
- _api.api_ExecutionResult_Value_Set(self.handle, value.handle)
1572
- else:
1573
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1574
- @property
1575
- def RawValue(self):
1576
- """Raw Objective-LOL value (for advanced use)
1577
- """
1578
- return go.environment_Value(handle=_api.api_ExecutionResult_RawValue_Get(self.handle))
1579
- @RawValue.setter
1580
- def RawValue(self, value):
1581
- if isinstance(value, go.GoClass):
1582
- _api.api_ExecutionResult_RawValue_Set(self.handle, value.handle)
1583
- else:
1584
- raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1585
- @property
1586
- def Output(self):
1587
- """Output captured during execution (if configured)
1588
- """
1589
- return _api.api_ExecutionResult_Output_Get(self.handle)
1590
- @Output.setter
1591
- def Output(self, value):
1592
- if isinstance(value, go.GoClass):
1593
- _api.api_ExecutionResult_Output_Set(self.handle, value.handle)
1594
- else:
1595
- _api.api_ExecutionResult_Output_Set(self.handle, value)
1596
-
1597
- # Python type for struct api.GoValue
1598
- class GoValue(go.GoClass):
1599
- """"""
1600
- def __init__(self, *args, **kwargs):
1601
- """
1602
- handle=A Go-side object is always initialized with an explicit handle=arg
1603
- otherwise parameters can be unnamed in order of field names or named fields
1604
- in which case a new Go object is constructed first
1605
- """
1606
- if len(kwargs) == 1 and 'handle' in kwargs:
1607
- self.handle = kwargs['handle']
1608
- _api.IncRef(self.handle)
1609
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1610
- self.handle = args[0].handle
1611
- _api.IncRef(self.handle)
1612
- else:
1613
- self.handle = _api.api_GoValue_CTor()
1614
- _api.IncRef(self.handle)
1615
- def __del__(self):
1616
- _api.DecRef(self.handle)
1617
- def __str__(self):
1618
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1619
- sv = 'api.GoValue{'
1620
- first = True
1621
- for v in pr:
1622
- if callable(v[1]):
1623
- continue
1624
- if first:
1625
- first = False
1626
- else:
1627
- sv += ', '
1628
- sv += v[0] + '=' + str(v[1])
1629
- return sv + '}'
1630
- def __repr__(self):
1631
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1632
- sv = 'api.GoValue ( '
1633
- for v in pr:
1634
- if not callable(v[1]):
1635
- sv += v[0] + '=' + str(v[1]) + ', '
1636
- return sv + ')'
1637
- def ID(self):
1638
- """ID() str"""
1639
- return _api.api_GoValue_ID(self.handle)
1640
- def MarshalJSON(self):
1641
- """MarshalJSON() []int, str"""
1642
- return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
1643
- def Type(self):
1644
- """Type() str"""
1645
- return _api.api_GoValue_Type(self.handle)
1646
- def Int(self):
1647
- """Int() long, str"""
1648
- return _api.api_GoValue_Int(self.handle)
1649
- def Float(self):
1650
- """Float() float, str"""
1651
- return _api.api_GoValue_Float(self.handle)
1652
- def String(self):
1653
- """String() str, str"""
1654
- return _api.api_GoValue_String(self.handle)
1655
- def Bool(self):
1656
- """Bool() bool, str"""
1657
- return _api.api_GoValue_Bool(self.handle)
1658
- def Slice(self):
1659
- """Slice() []object, str"""
1660
- return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
1661
- def Map(self):
1662
- """Map() object, str"""
1663
- return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
1664
- def Object(self):
1665
- """Object() object, str"""
1666
- return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
1667
-
1668
- # Python type for struct api.UnknownFunctionHandler
1669
- class UnknownFunctionHandler(go.GoClass):
1670
- """"""
1671
- def __init__(self, *args, **kwargs):
1672
- """
1673
- handle=A Go-side object is always initialized with an explicit handle=arg
1674
- otherwise parameters can be unnamed in order of field names or named fields
1675
- in which case a new Go object is constructed first
1676
- """
1677
- if len(kwargs) == 1 and 'handle' in kwargs:
1678
- self.handle = kwargs['handle']
1679
- _api.IncRef(self.handle)
1680
- elif len(args) == 1 and isinstance(args[0], go.GoClass):
1681
- self.handle = args[0].handle
1682
- _api.IncRef(self.handle)
1683
- else:
1684
- self.handle = _api.api_UnknownFunctionHandler_CTor()
1685
- _api.IncRef(self.handle)
1686
- def __del__(self):
1687
- _api.DecRef(self.handle)
1688
- def __str__(self):
1689
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1690
- sv = 'api.UnknownFunctionHandler{'
1691
- first = True
1692
- for v in pr:
1693
- if callable(v[1]):
1694
- continue
1695
- if first:
1696
- first = False
1697
- else:
1698
- sv += ', '
1699
- sv += v[0] + '=' + str(v[1])
1700
- return sv + '}'
1701
- def __repr__(self):
1702
- pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1703
- sv = 'api.UnknownFunctionHandler ( '
1704
- for v in pr:
1705
- if not callable(v[1]):
1706
- sv += v[0] + '=' + str(v[1]) + ', '
1707
- return sv + ')'
1698
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1699
+ @property
1700
+ def Locked(self):
1701
+ return _api.api_ClassVariable_Locked_Get(self.handle)
1702
+ @Locked.setter
1703
+ def Locked(self, value):
1704
+ if isinstance(value, go.GoClass):
1705
+ _api.api_ClassVariable_Locked_Set(self.handle, value.handle)
1706
+ else:
1707
+ _api.api_ClassVariable_Locked_Set(self.handle, value)
1708
1708
 
1709
1709
 
1710
1710
  # ---- Slices ---
@@ -1714,6 +1714,30 @@ class UnknownFunctionHandler(go.GoClass):
1714
1714
 
1715
1715
 
1716
1716
  # ---- Constructors ---
1717
+ def WrapBool(value):
1718
+ """WrapBool(bool value) object"""
1719
+ return GoValue(handle=_api.api_WrapBool(value))
1720
+ def WrapObject(value):
1721
+ """WrapObject(object value) object"""
1722
+ return GoValue(handle=_api.api_WrapObject(value.handle))
1723
+ def WrapAny(value):
1724
+ """WrapAny(str value) object"""
1725
+ return GoValue(handle=_api.api_WrapAny(value))
1726
+ def WrapInt(value):
1727
+ """WrapInt(long value) object"""
1728
+ return GoValue(handle=_api.api_WrapInt(value))
1729
+ def ToGoValue(val):
1730
+ """ToGoValue(object val) object, str
1731
+
1732
+ ToGoValue converts an Objective-LOL value to a Go value
1733
+ """
1734
+ return GoValue(handle=_api.api_ToGoValue(val.handle))
1735
+ def WrapFloat(value):
1736
+ """WrapFloat(float value) object"""
1737
+ return GoValue(handle=_api.api_WrapFloat(value))
1738
+ def WrapString(value):
1739
+ """WrapString(str value) object"""
1740
+ return GoValue(handle=_api.api_WrapString(value))
1717
1741
  def NewVM(config):
1718
1742
  """NewVM(object config) object, str
1719
1743
 
@@ -1726,63 +1750,39 @@ def DefaultConfig():
1726
1750
  DefaultConfig returns a default configuration
1727
1751
  """
1728
1752
  return VMConfig(handle=_api.api_DefaultConfig())
1729
- def NewCompileError(message, source):
1730
- """NewCompileError(str message, object source) object
1753
+ def NewRuntimeError(message, source):
1754
+ """NewRuntimeError(str message, object source) object
1731
1755
 
1732
- NewCompileError creates a new compile error
1756
+ NewRuntimeError creates a new runtime error
1733
1757
  """
1734
- return VMError(handle=_api.api_NewCompileError(message, source.handle))
1758
+ return VMError(handle=_api.api_NewRuntimeError(message, source.handle))
1735
1759
  def NewTimeoutError(duration):
1736
1760
  """NewTimeoutError(long duration) object
1737
1761
 
1738
1762
  NewTimeoutError creates a new timeout error
1739
1763
  """
1740
1764
  return VMError(handle=_api.api_NewTimeoutError(duration))
1741
- def NewConfigError(message, wrapped):
1742
- """NewConfigError(str message, str wrapped) object
1743
-
1744
- NewConfigError creates a new configuration error
1745
- """
1746
- return VMError(handle=_api.api_NewConfigError(message, wrapped))
1747
1765
  def NewConversionError(message, wrapped):
1748
1766
  """NewConversionError(str message, str wrapped) object
1749
1767
 
1750
1768
  NewConversionError creates a new type conversion error
1751
1769
  """
1752
1770
  return VMError(handle=_api.api_NewConversionError(message, wrapped))
1753
- def NewRuntimeError(message, source):
1754
- """NewRuntimeError(str message, object source) object
1771
+ def NewCompileError(message, source):
1772
+ """NewCompileError(str message, object source) object
1755
1773
 
1756
- NewRuntimeError creates a new runtime error
1774
+ NewCompileError creates a new compile error
1757
1775
  """
1758
- return VMError(handle=_api.api_NewRuntimeError(message, source.handle))
1776
+ return VMError(handle=_api.api_NewCompileError(message, source.handle))
1777
+ def NewConfigError(message, wrapped):
1778
+ """NewConfigError(str message, str wrapped) object
1779
+
1780
+ NewConfigError creates a new configuration error
1781
+ """
1782
+ return VMError(handle=_api.api_NewConfigError(message, wrapped))
1759
1783
  def NewClassDefinition():
1760
1784
  """NewClassDefinition() object"""
1761
1785
  return ClassDefinition(handle=_api.api_NewClassDefinition())
1762
- def ToGoValue(val):
1763
- """ToGoValue(object val) object, str
1764
-
1765
- ToGoValue converts an Objective-LOL value to a Go value
1766
- """
1767
- return GoValue(handle=_api.api_ToGoValue(val.handle))
1768
- def WrapObject(value):
1769
- """WrapObject(object value) object"""
1770
- return GoValue(handle=_api.api_WrapObject(value.handle))
1771
- def WrapBool(value):
1772
- """WrapBool(bool value) object"""
1773
- return GoValue(handle=_api.api_WrapBool(value))
1774
- def WrapString(value):
1775
- """WrapString(str value) object"""
1776
- return GoValue(handle=_api.api_WrapString(value))
1777
- def WrapInt(value):
1778
- """WrapInt(long value) object"""
1779
- return GoValue(handle=_api.api_WrapInt(value))
1780
- def WrapAny(value):
1781
- """WrapAny(str value) object"""
1782
- return GoValue(handle=_api.api_WrapAny(value))
1783
- def WrapFloat(value):
1784
- """WrapFloat(float value) object"""
1785
- return GoValue(handle=_api.api_WrapFloat(value))
1786
1786
 
1787
1787
 
1788
1788
  # ---- Functions ---