objective-lol 0.0.1__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
objective_lol/api.py ADDED
@@ -0,0 +1,1805 @@
1
+
2
+ # python wrapper for package github.com/bjia56/objective-lol/pkg/api within overall package api
3
+ # This is what you import to use the package.
4
+ # File is generated by gopy. Do not edit.
5
+ # gopy.exe build -no-make -dynamic-link=True -symbols=False -output D:\a\objective-lol\objective-lol\python\build\lib.win-amd64-cpython-313\objective_lol --vm D:\a\objective-lol\objective-lol\python\.toolchain\python\python-3.13.5\bin\python.exe .
6
+
7
+ # the following is required to enable dlopen to open the _go.so file
8
+ import os,sys,inspect,collections
9
+ try:
10
+ import collections.abc as _collections_abc
11
+ except ImportError:
12
+ _collections_abc = collections
13
+
14
+ cwd = os.getcwd()
15
+ currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
16
+ os.chdir(currentdir)
17
+ from . import _api
18
+ from . import go
19
+
20
+ os.chdir(cwd)
21
+
22
+ # to use this code in your end-user python file, import it as follows:
23
+ # from api import api
24
+ # and then refer to everything using api. prefix
25
+ # packages imported by this package listed below:
26
+
27
+
28
+
29
+
30
+ # ---- Types ---
31
+
32
+ # Python type for slice []api.GoValue
33
+ class Slice_api_GoValue(go.GoClass):
34
+ """"""
35
+ def __init__(self, *args, **kwargs):
36
+ """
37
+ handle=A Go-side object is always initialized with an explicit handle=arg
38
+ otherwise parameter is a python list that we copy from
39
+ """
40
+ self.index = 0
41
+ if len(kwargs) == 1 and 'handle' in kwargs:
42
+ self.handle = kwargs['handle']
43
+ _api.IncRef(self.handle)
44
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
45
+ self.handle = args[0].handle
46
+ _api.IncRef(self.handle)
47
+ else:
48
+ self.handle = _api.Slice_api_GoValue_CTor()
49
+ _api.IncRef(self.handle)
50
+ if len(args) > 0:
51
+ if not isinstance(args[0], _collections_abc.Iterable):
52
+ raise TypeError('Slice_api_GoValue.__init__ takes a sequence as argument')
53
+ for elt in args[0]:
54
+ self.append(elt)
55
+ def __del__(self):
56
+ _api.DecRef(self.handle)
57
+ def __str__(self):
58
+ s = 'api.Slice_api_GoValue len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
59
+ if len(self) < 120:
60
+ s += ', '.join(map(str, self)) + ']'
61
+ return s
62
+ def __repr__(self):
63
+ return 'api.Slice_api_GoValue([' + ', '.join(map(str, self)) + '])'
64
+ def __len__(self):
65
+ return _api.Slice_api_GoValue_len(self.handle)
66
+ def __getitem__(self, key):
67
+ if isinstance(key, slice):
68
+ if key.step == None or key.step == 1:
69
+ st = key.start
70
+ ed = key.stop
71
+ if st == None:
72
+ st = 0
73
+ if ed == None:
74
+ ed = _api.Slice_api_GoValue_len(self.handle)
75
+ return Slice_api_GoValue(handle=_api.Slice_api_GoValue_subslice(self.handle, st, ed))
76
+ return [self[ii] for ii in range(*key.indices(len(self)))]
77
+ elif isinstance(key, int):
78
+ if key < 0:
79
+ key += len(self)
80
+ if key < 0 or key >= len(self):
81
+ raise IndexError('slice index out of range')
82
+ return GoValue(handle=_api.Slice_api_GoValue_elem(self.handle, key))
83
+ else:
84
+ raise TypeError('slice index invalid type')
85
+ def __setitem__(self, idx, value):
86
+ if idx < 0:
87
+ idx += len(self)
88
+ if idx < len(self):
89
+ _api.Slice_api_GoValue_set(self.handle, idx, value.handle)
90
+ return
91
+ raise IndexError('slice index out of range')
92
+ def __iadd__(self, value):
93
+ if not isinstance(value, _collections_abc.Iterable):
94
+ raise TypeError('Slice_api_GoValue.__iadd__ takes a sequence as argument')
95
+ for elt in value:
96
+ self.append(elt)
97
+ return self
98
+ def __iter__(self):
99
+ self.index = 0
100
+ return self
101
+ def __next__(self):
102
+ if self.index < len(self):
103
+ rv = GoValue(handle=_api.Slice_api_GoValue_elem(self.handle, self.index))
104
+ self.index = self.index + 1
105
+ return rv
106
+ raise StopIteration
107
+ def append(self, value):
108
+ _api.Slice_api_GoValue_append(self.handle, value.handle)
109
+ def copy(self, src):
110
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
111
+ mx = min(len(self), len(src))
112
+ for i in range(mx):
113
+ self[i] = src[i]
114
+
115
+ # Python type for slice []environment.Parameter
116
+ class Slice_environment_Parameter(go.GoClass):
117
+ """"""
118
+ def __init__(self, *args, **kwargs):
119
+ """
120
+ handle=A Go-side object is always initialized with an explicit handle=arg
121
+ otherwise parameter is a python list that we copy from
122
+ """
123
+ self.index = 0
124
+ if len(kwargs) == 1 and 'handle' in kwargs:
125
+ self.handle = kwargs['handle']
126
+ _api.IncRef(self.handle)
127
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
128
+ self.handle = args[0].handle
129
+ _api.IncRef(self.handle)
130
+ else:
131
+ self.handle = _api.Slice_environment_Parameter_CTor()
132
+ _api.IncRef(self.handle)
133
+ if len(args) > 0:
134
+ if not isinstance(args[0], _collections_abc.Iterable):
135
+ raise TypeError('Slice_environment_Parameter.__init__ takes a sequence as argument')
136
+ for elt in args[0]:
137
+ self.append(elt)
138
+ def __del__(self):
139
+ _api.DecRef(self.handle)
140
+ def __str__(self):
141
+ s = 'api.Slice_environment_Parameter len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
142
+ if len(self) < 120:
143
+ s += ', '.join(map(str, self)) + ']'
144
+ return s
145
+ def __repr__(self):
146
+ return 'api.Slice_environment_Parameter([' + ', '.join(map(str, self)) + '])'
147
+ def __len__(self):
148
+ return _api.Slice_environment_Parameter_len(self.handle)
149
+ def __getitem__(self, key):
150
+ if isinstance(key, slice):
151
+ if key.step == None or key.step == 1:
152
+ st = key.start
153
+ ed = key.stop
154
+ if st == None:
155
+ st = 0
156
+ if ed == None:
157
+ ed = _api.Slice_environment_Parameter_len(self.handle)
158
+ return Slice_environment_Parameter(handle=_api.Slice_environment_Parameter_subslice(self.handle, st, ed))
159
+ return [self[ii] for ii in range(*key.indices(len(self)))]
160
+ elif isinstance(key, int):
161
+ if key < 0:
162
+ key += len(self)
163
+ if key < 0 or key >= len(self):
164
+ raise IndexError('slice index out of range')
165
+ return go.environment_Parameter(handle=_api.Slice_environment_Parameter_elem(self.handle, key))
166
+ else:
167
+ raise TypeError('slice index invalid type')
168
+ def __setitem__(self, idx, value):
169
+ if idx < 0:
170
+ idx += len(self)
171
+ if idx < len(self):
172
+ _api.Slice_environment_Parameter_set(self.handle, idx, value.handle)
173
+ return
174
+ raise IndexError('slice index out of range')
175
+ def __iadd__(self, value):
176
+ if not isinstance(value, _collections_abc.Iterable):
177
+ raise TypeError('Slice_environment_Parameter.__iadd__ takes a sequence as argument')
178
+ for elt in value:
179
+ self.append(elt)
180
+ return self
181
+ def __iter__(self):
182
+ self.index = 0
183
+ return self
184
+ def __next__(self):
185
+ if self.index < len(self):
186
+ rv = go.environment_Parameter(handle=_api.Slice_environment_Parameter_elem(self.handle, self.index))
187
+ self.index = self.index + 1
188
+ return rv
189
+ raise StopIteration
190
+ def append(self, value):
191
+ _api.Slice_environment_Parameter_append(self.handle, value.handle)
192
+ def copy(self, src):
193
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
194
+ mx = min(len(self), len(src))
195
+ for i in range(mx):
196
+ self[i] = src[i]
197
+
198
+ # Python type for slice []environment.Value
199
+ class Slice_environment_Value(go.GoClass):
200
+ """"""
201
+ def __init__(self, *args, **kwargs):
202
+ """
203
+ handle=A Go-side object is always initialized with an explicit handle=arg
204
+ otherwise parameter is a python list that we copy from
205
+ """
206
+ self.index = 0
207
+ if len(kwargs) == 1 and 'handle' in kwargs:
208
+ self.handle = kwargs['handle']
209
+ _api.IncRef(self.handle)
210
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
211
+ self.handle = args[0].handle
212
+ _api.IncRef(self.handle)
213
+ else:
214
+ self.handle = _api.Slice_environment_Value_CTor()
215
+ _api.IncRef(self.handle)
216
+ if len(args) > 0:
217
+ if not isinstance(args[0], _collections_abc.Iterable):
218
+ raise TypeError('Slice_environment_Value.__init__ takes a sequence as argument')
219
+ for elt in args[0]:
220
+ self.append(elt)
221
+ def __del__(self):
222
+ _api.DecRef(self.handle)
223
+ def __str__(self):
224
+ s = 'api.Slice_environment_Value len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
225
+ if len(self) < 120:
226
+ s += ', '.join(map(str, self)) + ']'
227
+ return s
228
+ def __repr__(self):
229
+ return 'api.Slice_environment_Value([' + ', '.join(map(str, self)) + '])'
230
+ def __len__(self):
231
+ return _api.Slice_environment_Value_len(self.handle)
232
+ def __getitem__(self, key):
233
+ if isinstance(key, slice):
234
+ if key.step == None or key.step == 1:
235
+ st = key.start
236
+ ed = key.stop
237
+ if st == None:
238
+ st = 0
239
+ if ed == None:
240
+ ed = _api.Slice_environment_Value_len(self.handle)
241
+ return Slice_environment_Value(handle=_api.Slice_environment_Value_subslice(self.handle, st, ed))
242
+ return [self[ii] for ii in range(*key.indices(len(self)))]
243
+ elif isinstance(key, int):
244
+ if key < 0:
245
+ key += len(self)
246
+ if key < 0 or key >= len(self):
247
+ raise IndexError('slice index out of range')
248
+ return go.environment_Value(handle=_api.Slice_environment_Value_elem(self.handle, key))
249
+ else:
250
+ raise TypeError('slice index invalid type')
251
+ def __setitem__(self, idx, value):
252
+ if idx < 0:
253
+ idx += len(self)
254
+ if idx < len(self):
255
+ _api.Slice_environment_Value_set(self.handle, idx, value.handle)
256
+ return
257
+ raise IndexError('slice index out of range')
258
+ def __iadd__(self, value):
259
+ if not isinstance(value, _collections_abc.Iterable):
260
+ raise TypeError('Slice_environment_Value.__iadd__ takes a sequence as argument')
261
+ for elt in value:
262
+ self.append(elt)
263
+ return self
264
+ def __iter__(self):
265
+ self.index = 0
266
+ return self
267
+ def __next__(self):
268
+ if self.index < len(self):
269
+ rv = go.environment_Value(handle=_api.Slice_environment_Value_elem(self.handle, self.index))
270
+ self.index = self.index + 1
271
+ return rv
272
+ raise StopIteration
273
+ def append(self, value):
274
+ _api.Slice_environment_Value_append(self.handle, value.handle)
275
+ def copy(self, src):
276
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
277
+ mx = min(len(self), len(src))
278
+ for i in range(mx):
279
+ self[i] = src[i]
280
+
281
+ # Python type for map map[string]*api.ClassMethod
282
+ class Map_string_Ptr_api_ClassMethod(go.GoClass):
283
+ """"""
284
+ def __init__(self, *args, **kwargs):
285
+ """
286
+ handle=A Go-side object is always initialized with an explicit handle=arg
287
+ otherwise parameter is a python list that we copy from
288
+ """
289
+ self.index = 0
290
+ if len(kwargs) == 1 and 'handle' in kwargs:
291
+ self.handle = kwargs['handle']
292
+ _api.IncRef(self.handle)
293
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
294
+ self.handle = args[0].handle
295
+ _api.IncRef(self.handle)
296
+ else:
297
+ self.handle = _api.Map_string_Ptr_api_ClassMethod_CTor()
298
+ _api.IncRef(self.handle)
299
+ if len(args) > 0:
300
+ if not isinstance(args[0], _collections_abc.Mapping):
301
+ raise TypeError('Map_string_Ptr_api_ClassMethod.__init__ takes a mapping as argument')
302
+ for k, v in args[0].items():
303
+ _api.Map_string_Ptr_api_ClassMethod_set(self.handle, k, v)
304
+ def __del__(self):
305
+ _api.DecRef(self.handle)
306
+ def __str__(self):
307
+ s = 'api.Map_string_Ptr_api_ClassMethod len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' {'
308
+ if len(self) < 120:
309
+ for k, v in self.items():
310
+ s += str(k) + '=' + str(v) + ', '
311
+ return s + '}'
312
+ def __repr__(self):
313
+ s = 'api.Map_string_Ptr_api_ClassMethod({'
314
+ for k, v in self.items():
315
+ s += str(k) + '=' + str(v) + ', '
316
+ return s + '})'
317
+ def __len__(self):
318
+ return _api.Map_string_Ptr_api_ClassMethod_len(self.handle)
319
+ def __getitem__(self, key):
320
+ return ClassMethod(handle=_api.Map_string_Ptr_api_ClassMethod_elem(self.handle, key))
321
+ def __setitem__(self, key, value):
322
+ _api.Map_string_Ptr_api_ClassMethod_set(self.handle, key, value.handle)
323
+ def __delitem__(self, key):
324
+ return _api.Map_string_Ptr_api_ClassMethod_delete(self.handle, key)
325
+ def keys(self):
326
+ return go.Slice_string(handle=_api.Map_string_Ptr_api_ClassMethod_keys(self.handle))
327
+ def values(self):
328
+ vls = []
329
+ kys = self.keys()
330
+ for k in kys:
331
+ vls.append(self[k])
332
+ return vls
333
+ def items(self):
334
+ vls = []
335
+ kys = self.keys()
336
+ for k in kys:
337
+ vls.append((k, self[k]))
338
+ return vls
339
+ def __iter__(self):
340
+ return iter(self.items())
341
+ def __contains__(self, key):
342
+ return _api.Map_string_Ptr_api_ClassMethod_contains(self.handle, key)
343
+
344
+ # Python type for map map[string]*api.ClassVariable
345
+ class Map_string_Ptr_api_ClassVariable(go.GoClass):
346
+ """"""
347
+ def __init__(self, *args, **kwargs):
348
+ """
349
+ handle=A Go-side object is always initialized with an explicit handle=arg
350
+ otherwise parameter is a python list that we copy from
351
+ """
352
+ self.index = 0
353
+ if len(kwargs) == 1 and 'handle' in kwargs:
354
+ self.handle = kwargs['handle']
355
+ _api.IncRef(self.handle)
356
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
357
+ self.handle = args[0].handle
358
+ _api.IncRef(self.handle)
359
+ else:
360
+ self.handle = _api.Map_string_Ptr_api_ClassVariable_CTor()
361
+ _api.IncRef(self.handle)
362
+ if len(args) > 0:
363
+ if not isinstance(args[0], _collections_abc.Mapping):
364
+ raise TypeError('Map_string_Ptr_api_ClassVariable.__init__ takes a mapping as argument')
365
+ for k, v in args[0].items():
366
+ _api.Map_string_Ptr_api_ClassVariable_set(self.handle, k, v)
367
+ def __del__(self):
368
+ _api.DecRef(self.handle)
369
+ def __str__(self):
370
+ s = 'api.Map_string_Ptr_api_ClassVariable len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' {'
371
+ if len(self) < 120:
372
+ for k, v in self.items():
373
+ s += str(k) + '=' + str(v) + ', '
374
+ return s + '}'
375
+ def __repr__(self):
376
+ s = 'api.Map_string_Ptr_api_ClassVariable({'
377
+ for k, v in self.items():
378
+ s += str(k) + '=' + str(v) + ', '
379
+ return s + '})'
380
+ def __len__(self):
381
+ return _api.Map_string_Ptr_api_ClassVariable_len(self.handle)
382
+ def __getitem__(self, key):
383
+ return ClassVariable(handle=_api.Map_string_Ptr_api_ClassVariable_elem(self.handle, key))
384
+ def __setitem__(self, key, value):
385
+ _api.Map_string_Ptr_api_ClassVariable_set(self.handle, key, value.handle)
386
+ def __delitem__(self, key):
387
+ return _api.Map_string_Ptr_api_ClassVariable_delete(self.handle, key)
388
+ def keys(self):
389
+ return go.Slice_string(handle=_api.Map_string_Ptr_api_ClassVariable_keys(self.handle))
390
+ def values(self):
391
+ vls = []
392
+ kys = self.keys()
393
+ for k in kys:
394
+ vls.append(self[k])
395
+ return vls
396
+ def items(self):
397
+ vls = []
398
+ kys = self.keys()
399
+ for k in kys:
400
+ vls.append((k, self[k]))
401
+ return vls
402
+ def __iter__(self):
403
+ return iter(self.items())
404
+ def __contains__(self, key):
405
+ return _api.Map_string_Ptr_api_ClassVariable_contains(self.handle, key)
406
+
407
+ # Python type for map map[string]*environment.Class
408
+ class Map_string_Ptr_environment_Class(go.GoClass):
409
+ """"""
410
+ def __init__(self, *args, **kwargs):
411
+ """
412
+ handle=A Go-side object is always initialized with an explicit handle=arg
413
+ otherwise parameter is a python list that we copy from
414
+ """
415
+ self.index = 0
416
+ if len(kwargs) == 1 and 'handle' in kwargs:
417
+ self.handle = kwargs['handle']
418
+ _api.IncRef(self.handle)
419
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
420
+ self.handle = args[0].handle
421
+ _api.IncRef(self.handle)
422
+ else:
423
+ self.handle = _api.Map_string_Ptr_environment_Class_CTor()
424
+ _api.IncRef(self.handle)
425
+ if len(args) > 0:
426
+ if not isinstance(args[0], _collections_abc.Mapping):
427
+ raise TypeError('Map_string_Ptr_environment_Class.__init__ takes a mapping as argument')
428
+ for k, v in args[0].items():
429
+ _api.Map_string_Ptr_environment_Class_set(self.handle, k, v)
430
+ def __del__(self):
431
+ _api.DecRef(self.handle)
432
+ def __str__(self):
433
+ s = 'api.Map_string_Ptr_environment_Class len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' {'
434
+ if len(self) < 120:
435
+ for k, v in self.items():
436
+ s += str(k) + '=' + str(v) + ', '
437
+ return s + '}'
438
+ def __repr__(self):
439
+ s = 'api.Map_string_Ptr_environment_Class({'
440
+ for k, v in self.items():
441
+ s += str(k) + '=' + str(v) + ', '
442
+ return s + '})'
443
+ def __len__(self):
444
+ return _api.Map_string_Ptr_environment_Class_len(self.handle)
445
+ def __getitem__(self, key):
446
+ return go.Ptr_environment_Class(handle=_api.Map_string_Ptr_environment_Class_elem(self.handle, key))
447
+ def __setitem__(self, key, value):
448
+ _api.Map_string_Ptr_environment_Class_set(self.handle, key, value.handle)
449
+ def __delitem__(self, key):
450
+ return _api.Map_string_Ptr_environment_Class_delete(self.handle, key)
451
+ def keys(self):
452
+ return go.Slice_string(handle=_api.Map_string_Ptr_environment_Class_keys(self.handle))
453
+ def values(self):
454
+ vls = []
455
+ kys = self.keys()
456
+ for k in kys:
457
+ vls.append(self[k])
458
+ return vls
459
+ def items(self):
460
+ vls = []
461
+ kys = self.keys()
462
+ for k in kys:
463
+ vls.append((k, self[k]))
464
+ return vls
465
+ def __iter__(self):
466
+ return iter(self.items())
467
+ def __contains__(self, key):
468
+ return _api.Map_string_Ptr_environment_Class_contains(self.handle, key)
469
+
470
+ # Python type for map map[string]*environment.Function
471
+ class Map_string_Ptr_environment_Function(go.GoClass):
472
+ """"""
473
+ def __init__(self, *args, **kwargs):
474
+ """
475
+ handle=A Go-side object is always initialized with an explicit handle=arg
476
+ otherwise parameter is a python list that we copy from
477
+ """
478
+ self.index = 0
479
+ if len(kwargs) == 1 and 'handle' in kwargs:
480
+ self.handle = kwargs['handle']
481
+ _api.IncRef(self.handle)
482
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
483
+ self.handle = args[0].handle
484
+ _api.IncRef(self.handle)
485
+ else:
486
+ self.handle = _api.Map_string_Ptr_environment_Function_CTor()
487
+ _api.IncRef(self.handle)
488
+ if len(args) > 0:
489
+ if not isinstance(args[0], _collections_abc.Mapping):
490
+ raise TypeError('Map_string_Ptr_environment_Function.__init__ takes a mapping as argument')
491
+ for k, v in args[0].items():
492
+ _api.Map_string_Ptr_environment_Function_set(self.handle, k, v)
493
+ def __del__(self):
494
+ _api.DecRef(self.handle)
495
+ def __str__(self):
496
+ s = 'api.Map_string_Ptr_environment_Function len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' {'
497
+ if len(self) < 120:
498
+ for k, v in self.items():
499
+ s += str(k) + '=' + str(v) + ', '
500
+ return s + '}'
501
+ def __repr__(self):
502
+ s = 'api.Map_string_Ptr_environment_Function({'
503
+ for k, v in self.items():
504
+ s += str(k) + '=' + str(v) + ', '
505
+ return s + '})'
506
+ def __len__(self):
507
+ return _api.Map_string_Ptr_environment_Function_len(self.handle)
508
+ def __getitem__(self, key):
509
+ return go.Ptr_environment_Function(handle=_api.Map_string_Ptr_environment_Function_elem(self.handle, key))
510
+ def __setitem__(self, key, value):
511
+ _api.Map_string_Ptr_environment_Function_set(self.handle, key, value.handle)
512
+ def __delitem__(self, key):
513
+ return _api.Map_string_Ptr_environment_Function_delete(self.handle, key)
514
+ def keys(self):
515
+ return go.Slice_string(handle=_api.Map_string_Ptr_environment_Function_keys(self.handle))
516
+ def values(self):
517
+ vls = []
518
+ kys = self.keys()
519
+ for k in kys:
520
+ vls.append(self[k])
521
+ return vls
522
+ def items(self):
523
+ vls = []
524
+ kys = self.keys()
525
+ for k in kys:
526
+ vls.append((k, self[k]))
527
+ return vls
528
+ def __iter__(self):
529
+ return iter(self.items())
530
+ def __contains__(self, key):
531
+ return _api.Map_string_Ptr_environment_Function_contains(self.handle, key)
532
+
533
+ # Python type for map map[string]*environment.MemberVariable
534
+ class Map_string_Ptr_environment_MemberVariable(go.GoClass):
535
+ """"""
536
+ def __init__(self, *args, **kwargs):
537
+ """
538
+ handle=A Go-side object is always initialized with an explicit handle=arg
539
+ otherwise parameter is a python list that we copy from
540
+ """
541
+ self.index = 0
542
+ if len(kwargs) == 1 and 'handle' in kwargs:
543
+ self.handle = kwargs['handle']
544
+ _api.IncRef(self.handle)
545
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
546
+ self.handle = args[0].handle
547
+ _api.IncRef(self.handle)
548
+ else:
549
+ self.handle = _api.Map_string_Ptr_environment_MemberVariable_CTor()
550
+ _api.IncRef(self.handle)
551
+ if len(args) > 0:
552
+ if not isinstance(args[0], _collections_abc.Mapping):
553
+ raise TypeError('Map_string_Ptr_environment_MemberVariable.__init__ takes a mapping as argument')
554
+ for k, v in args[0].items():
555
+ _api.Map_string_Ptr_environment_MemberVariable_set(self.handle, k, v)
556
+ def __del__(self):
557
+ _api.DecRef(self.handle)
558
+ def __str__(self):
559
+ s = 'api.Map_string_Ptr_environment_MemberVariable len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' {'
560
+ if len(self) < 120:
561
+ for k, v in self.items():
562
+ s += str(k) + '=' + str(v) + ', '
563
+ return s + '}'
564
+ def __repr__(self):
565
+ s = 'api.Map_string_Ptr_environment_MemberVariable({'
566
+ for k, v in self.items():
567
+ s += str(k) + '=' + str(v) + ', '
568
+ return s + '})'
569
+ def __len__(self):
570
+ return _api.Map_string_Ptr_environment_MemberVariable_len(self.handle)
571
+ def __getitem__(self, key):
572
+ return go.Ptr_environment_MemberVariable(handle=_api.Map_string_Ptr_environment_MemberVariable_elem(self.handle, key))
573
+ def __setitem__(self, key, value):
574
+ _api.Map_string_Ptr_environment_MemberVariable_set(self.handle, key, value.handle)
575
+ def __delitem__(self, key):
576
+ return _api.Map_string_Ptr_environment_MemberVariable_delete(self.handle, key)
577
+ def keys(self):
578
+ return go.Slice_string(handle=_api.Map_string_Ptr_environment_MemberVariable_keys(self.handle))
579
+ def values(self):
580
+ vls = []
581
+ kys = self.keys()
582
+ for k in kys:
583
+ vls.append(self[k])
584
+ return vls
585
+ def items(self):
586
+ vls = []
587
+ kys = self.keys()
588
+ for k in kys:
589
+ vls.append((k, self[k]))
590
+ return vls
591
+ def __iter__(self):
592
+ return iter(self.items())
593
+ def __contains__(self, key):
594
+ return _api.Map_string_Ptr_environment_MemberVariable_contains(self.handle, key)
595
+
596
+ # Python type for map map[string]*environment.Variable
597
+ class Map_string_Ptr_environment_Variable(go.GoClass):
598
+ """"""
599
+ def __init__(self, *args, **kwargs):
600
+ """
601
+ handle=A Go-side object is always initialized with an explicit handle=arg
602
+ otherwise parameter is a python list that we copy from
603
+ """
604
+ self.index = 0
605
+ if len(kwargs) == 1 and 'handle' in kwargs:
606
+ self.handle = kwargs['handle']
607
+ _api.IncRef(self.handle)
608
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
609
+ self.handle = args[0].handle
610
+ _api.IncRef(self.handle)
611
+ else:
612
+ self.handle = _api.Map_string_Ptr_environment_Variable_CTor()
613
+ _api.IncRef(self.handle)
614
+ if len(args) > 0:
615
+ if not isinstance(args[0], _collections_abc.Mapping):
616
+ raise TypeError('Map_string_Ptr_environment_Variable.__init__ takes a mapping as argument')
617
+ for k, v in args[0].items():
618
+ _api.Map_string_Ptr_environment_Variable_set(self.handle, k, v)
619
+ def __del__(self):
620
+ _api.DecRef(self.handle)
621
+ def __str__(self):
622
+ s = 'api.Map_string_Ptr_environment_Variable len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' {'
623
+ if len(self) < 120:
624
+ for k, v in self.items():
625
+ s += str(k) + '=' + str(v) + ', '
626
+ return s + '}'
627
+ def __repr__(self):
628
+ s = 'api.Map_string_Ptr_environment_Variable({'
629
+ for k, v in self.items():
630
+ s += str(k) + '=' + str(v) + ', '
631
+ return s + '})'
632
+ def __len__(self):
633
+ return _api.Map_string_Ptr_environment_Variable_len(self.handle)
634
+ def __getitem__(self, key):
635
+ return go.Ptr_environment_Variable(handle=_api.Map_string_Ptr_environment_Variable_elem(self.handle, key))
636
+ def __setitem__(self, key, value):
637
+ _api.Map_string_Ptr_environment_Variable_set(self.handle, key, value.handle)
638
+ def __delitem__(self, key):
639
+ return _api.Map_string_Ptr_environment_Variable_delete(self.handle, key)
640
+ def keys(self):
641
+ return go.Slice_string(handle=_api.Map_string_Ptr_environment_Variable_keys(self.handle))
642
+ def values(self):
643
+ vls = []
644
+ kys = self.keys()
645
+ for k in kys:
646
+ vls.append(self[k])
647
+ return vls
648
+ def items(self):
649
+ vls = []
650
+ kys = self.keys()
651
+ for k in kys:
652
+ vls.append((k, self[k]))
653
+ return vls
654
+ def __iter__(self):
655
+ return iter(self.items())
656
+ def __contains__(self, key):
657
+ return _api.Map_string_Ptr_environment_Variable_contains(self.handle, key)
658
+
659
+ # Python type for map map[string]api.GoValue
660
+ class Map_string_api_GoValue(go.GoClass):
661
+ """"""
662
+ def __init__(self, *args, **kwargs):
663
+ """
664
+ handle=A Go-side object is always initialized with an explicit handle=arg
665
+ otherwise parameter is a python list that we copy from
666
+ """
667
+ self.index = 0
668
+ if len(kwargs) == 1 and 'handle' in kwargs:
669
+ self.handle = kwargs['handle']
670
+ _api.IncRef(self.handle)
671
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
672
+ self.handle = args[0].handle
673
+ _api.IncRef(self.handle)
674
+ else:
675
+ self.handle = _api.Map_string_api_GoValue_CTor()
676
+ _api.IncRef(self.handle)
677
+ if len(args) > 0:
678
+ if not isinstance(args[0], _collections_abc.Mapping):
679
+ raise TypeError('Map_string_api_GoValue.__init__ takes a mapping as argument')
680
+ for k, v in args[0].items():
681
+ _api.Map_string_api_GoValue_set(self.handle, k, v)
682
+ def __del__(self):
683
+ _api.DecRef(self.handle)
684
+ def __str__(self):
685
+ s = 'api.Map_string_api_GoValue len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' {'
686
+ if len(self) < 120:
687
+ for k, v in self.items():
688
+ s += str(k) + '=' + str(v) + ', '
689
+ return s + '}'
690
+ def __repr__(self):
691
+ s = 'api.Map_string_api_GoValue({'
692
+ for k, v in self.items():
693
+ s += str(k) + '=' + str(v) + ', '
694
+ return s + '})'
695
+ def __len__(self):
696
+ return _api.Map_string_api_GoValue_len(self.handle)
697
+ def __getitem__(self, key):
698
+ return GoValue(handle=_api.Map_string_api_GoValue_elem(self.handle, key))
699
+ def __setitem__(self, key, value):
700
+ _api.Map_string_api_GoValue_set(self.handle, key, value.handle)
701
+ def __delitem__(self, key):
702
+ return _api.Map_string_api_GoValue_delete(self.handle, key)
703
+ def keys(self):
704
+ return go.Slice_string(handle=_api.Map_string_api_GoValue_keys(self.handle))
705
+ def values(self):
706
+ vls = []
707
+ kys = self.keys()
708
+ for k in kys:
709
+ vls.append(self[k])
710
+ return vls
711
+ def items(self):
712
+ vls = []
713
+ kys = self.keys()
714
+ for k in kys:
715
+ vls.append((k, self[k]))
716
+ return vls
717
+ def __iter__(self):
718
+ return iter(self.items())
719
+ def __contains__(self, key):
720
+ return _api.Map_string_api_GoValue_contains(self.handle, key)
721
+
722
+
723
+ #---- Enums from Go (collections of consts with same type) ---
724
+
725
+
726
+ #---- Constants from Go: Python can only ask that you please don't change these! ---
727
+ CompileErrorType = "compile"
728
+ ConfigErrorType = "config"
729
+ ConversionErrorType = "conversion"
730
+ ForeignModuleNamespace = "foreign:anonymous"
731
+ GoValueIDKey = "__GoValue_id"
732
+ RuntimeErrorType = "runtime"
733
+ TimeoutErrorType = "timeout"
734
+
735
+
736
+ # ---- Global Variables: can only use functions to access ---
737
+
738
+
739
+ # ---- Interfaces ---
740
+
741
+
742
+ # ---- Structs ---
743
+
744
+ # Python type for struct api.ClassMethod
745
+ class ClassMethod(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_ClassMethod_CTor()
761
+ _api.IncRef(self.handle)
762
+ if 0 < len(args):
763
+ self.Name = args[0]
764
+ if "Name" in kwargs:
765
+ self.Name = kwargs["Name"]
766
+ if 1 < len(args):
767
+ self.Argc = args[1]
768
+ if "Argc" in kwargs:
769
+ self.Argc = kwargs["Argc"]
770
+ def __del__(self):
771
+ _api.DecRef(self.handle)
772
+ def __str__(self):
773
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
774
+ sv = 'api.ClassMethod{'
775
+ first = True
776
+ for v in pr:
777
+ if callable(v[1]):
778
+ continue
779
+ if first:
780
+ first = False
781
+ else:
782
+ sv += ', '
783
+ sv += v[0] + '=' + str(v[1])
784
+ return sv + '}'
785
+ def __repr__(self):
786
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
787
+ sv = 'api.ClassMethod ( '
788
+ for v in pr:
789
+ if not callable(v[1]):
790
+ sv += v[0] + '=' + str(v[1]) + ', '
791
+ return sv + ')'
792
+ @property
793
+ def Name(self):
794
+ return _api.api_ClassMethod_Name_Get(self.handle)
795
+ @Name.setter
796
+ def Name(self, value):
797
+ if isinstance(value, go.GoClass):
798
+ _api.api_ClassMethod_Name_Set(self.handle, value.handle)
799
+ else:
800
+ _api.api_ClassMethod_Name_Set(self.handle, value)
801
+ @property
802
+ def Argc(self):
803
+ return _api.api_ClassMethod_Argc_Get(self.handle)
804
+ @Argc.setter
805
+ def Argc(self, value):
806
+ if isinstance(value, go.GoClass):
807
+ _api.api_ClassMethod_Argc_Set(self.handle, value.handle)
808
+ else:
809
+ _api.api_ClassMethod_Argc_Set(self.handle, value)
810
+
811
+ # Python type for struct api.ExecutionResult
812
+ class ExecutionResult(go.GoClass):
813
+ """ExecutionResult represents the result of executing Objective-LOL code\n"""
814
+ def __init__(self, *args, **kwargs):
815
+ """
816
+ handle=A Go-side object is always initialized with an explicit handle=arg
817
+ otherwise parameters can be unnamed in order of field names or named fields
818
+ in which case a new Go object is constructed first
819
+ """
820
+ if len(kwargs) == 1 and 'handle' in kwargs:
821
+ self.handle = kwargs['handle']
822
+ _api.IncRef(self.handle)
823
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
824
+ self.handle = args[0].handle
825
+ _api.IncRef(self.handle)
826
+ else:
827
+ self.handle = _api.api_ExecutionResult_CTor()
828
+ _api.IncRef(self.handle)
829
+ if 0 < len(args):
830
+ self.Value = args[0]
831
+ if "Value" in kwargs:
832
+ self.Value = kwargs["Value"]
833
+ if 1 < len(args):
834
+ self.RawValue = args[1]
835
+ if "RawValue" in kwargs:
836
+ self.RawValue = kwargs["RawValue"]
837
+ if 2 < len(args):
838
+ self.Output = args[2]
839
+ if "Output" in kwargs:
840
+ self.Output = kwargs["Output"]
841
+ def __del__(self):
842
+ _api.DecRef(self.handle)
843
+ def __str__(self):
844
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
845
+ sv = 'api.ExecutionResult{'
846
+ first = True
847
+ for v in pr:
848
+ if callable(v[1]):
849
+ continue
850
+ if first:
851
+ first = False
852
+ else:
853
+ sv += ', '
854
+ sv += v[0] + '=' + str(v[1])
855
+ return sv + '}'
856
+ def __repr__(self):
857
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
858
+ sv = 'api.ExecutionResult ( '
859
+ for v in pr:
860
+ if not callable(v[1]):
861
+ sv += v[0] + '=' + str(v[1]) + ', '
862
+ return sv + ')'
863
+ @property
864
+ def Value(self):
865
+ """Return value from the execution (e.g., from MAIN function)
866
+ """
867
+ return GoValue(handle=_api.api_ExecutionResult_Value_Get(self.handle))
868
+ @Value.setter
869
+ def Value(self, value):
870
+ if isinstance(value, go.GoClass):
871
+ _api.api_ExecutionResult_Value_Set(self.handle, value.handle)
872
+ else:
873
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
874
+ @property
875
+ def RawValue(self):
876
+ """Raw Objective-LOL value (for advanced use)
877
+ """
878
+ return go.environment_Value(handle=_api.api_ExecutionResult_RawValue_Get(self.handle))
879
+ @RawValue.setter
880
+ def RawValue(self, value):
881
+ if isinstance(value, go.GoClass):
882
+ _api.api_ExecutionResult_RawValue_Set(self.handle, value.handle)
883
+ else:
884
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
885
+ @property
886
+ def Output(self):
887
+ """Output captured during execution (if configured)
888
+ """
889
+ return _api.api_ExecutionResult_Output_Get(self.handle)
890
+ @Output.setter
891
+ def Output(self, value):
892
+ if isinstance(value, go.GoClass):
893
+ _api.api_ExecutionResult_Output_Set(self.handle, value.handle)
894
+ else:
895
+ _api.api_ExecutionResult_Output_Set(self.handle, value)
896
+
897
+ # Python type for struct api.GoValue
898
+ class GoValue(go.GoClass):
899
+ """"""
900
+ def __init__(self, *args, **kwargs):
901
+ """
902
+ handle=A Go-side object is always initialized with an explicit handle=arg
903
+ otherwise parameters can be unnamed in order of field names or named fields
904
+ in which case a new Go object is constructed first
905
+ """
906
+ if len(kwargs) == 1 and 'handle' in kwargs:
907
+ self.handle = kwargs['handle']
908
+ _api.IncRef(self.handle)
909
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
910
+ self.handle = args[0].handle
911
+ _api.IncRef(self.handle)
912
+ else:
913
+ self.handle = _api.api_GoValue_CTor()
914
+ _api.IncRef(self.handle)
915
+ def __del__(self):
916
+ _api.DecRef(self.handle)
917
+ def __str__(self):
918
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
919
+ sv = 'api.GoValue{'
920
+ first = True
921
+ for v in pr:
922
+ if callable(v[1]):
923
+ continue
924
+ if first:
925
+ first = False
926
+ else:
927
+ sv += ', '
928
+ sv += v[0] + '=' + str(v[1])
929
+ return sv + '}'
930
+ def __repr__(self):
931
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
932
+ sv = 'api.GoValue ( '
933
+ for v in pr:
934
+ if not callable(v[1]):
935
+ sv += v[0] + '=' + str(v[1]) + ', '
936
+ return sv + ')'
937
+ def ID(self):
938
+ """ID() str"""
939
+ return _api.api_GoValue_ID(self.handle)
940
+ def MarshalJSON(self):
941
+ """MarshalJSON() []int, str"""
942
+ return go.Slice_byte(handle=_api.api_GoValue_MarshalJSON(self.handle))
943
+ def Type(self):
944
+ """Type() str"""
945
+ return _api.api_GoValue_Type(self.handle)
946
+ def Int(self):
947
+ """Int() long, str"""
948
+ return _api.api_GoValue_Int(self.handle)
949
+ def Float(self):
950
+ """Float() float, str"""
951
+ return _api.api_GoValue_Float(self.handle)
952
+ def String(self):
953
+ """String() str, str"""
954
+ return _api.api_GoValue_String(self.handle)
955
+ def Bool(self):
956
+ """Bool() bool, str"""
957
+ return _api.api_GoValue_Bool(self.handle)
958
+ def Slice(self):
959
+ """Slice() []object, str"""
960
+ return Slice_api_GoValue(handle=_api.api_GoValue_Slice(self.handle))
961
+ def Map(self):
962
+ """Map() object, str"""
963
+ return Map_string_api_GoValue(handle=_api.api_GoValue_Map(self.handle))
964
+ def Object(self):
965
+ """Object() object, str"""
966
+ return go.Ptr_environment_ObjectInstance(handle=_api.api_GoValue_Object(self.handle))
967
+
968
+ # Python type for struct api.SourceLocation
969
+ class SourceLocation(go.GoClass):
970
+ """SourceLocation represents a location in source code\n"""
971
+ def __init__(self, *args, **kwargs):
972
+ """
973
+ handle=A Go-side object is always initialized with an explicit handle=arg
974
+ otherwise parameters can be unnamed in order of field names or named fields
975
+ in which case a new Go object is constructed first
976
+ """
977
+ if len(kwargs) == 1 and 'handle' in kwargs:
978
+ self.handle = kwargs['handle']
979
+ _api.IncRef(self.handle)
980
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
981
+ self.handle = args[0].handle
982
+ _api.IncRef(self.handle)
983
+ else:
984
+ self.handle = _api.api_SourceLocation_CTor()
985
+ _api.IncRef(self.handle)
986
+ if 0 < len(args):
987
+ self.Filename = args[0]
988
+ if "Filename" in kwargs:
989
+ self.Filename = kwargs["Filename"]
990
+ if 1 < len(args):
991
+ self.Line = args[1]
992
+ if "Line" in kwargs:
993
+ self.Line = kwargs["Line"]
994
+ if 2 < len(args):
995
+ self.Column = args[2]
996
+ if "Column" in kwargs:
997
+ self.Column = kwargs["Column"]
998
+ def __del__(self):
999
+ _api.DecRef(self.handle)
1000
+ def __str__(self):
1001
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1002
+ sv = 'api.SourceLocation{'
1003
+ first = True
1004
+ for v in pr:
1005
+ if callable(v[1]):
1006
+ continue
1007
+ if first:
1008
+ first = False
1009
+ else:
1010
+ sv += ', '
1011
+ sv += v[0] + '=' + str(v[1])
1012
+ return sv + '}'
1013
+ def __repr__(self):
1014
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1015
+ sv = 'api.SourceLocation ( '
1016
+ for v in pr:
1017
+ if not callable(v[1]):
1018
+ sv += v[0] + '=' + str(v[1]) + ', '
1019
+ return sv + ')'
1020
+ @property
1021
+ def Filename(self):
1022
+ return _api.api_SourceLocation_Filename_Get(self.handle)
1023
+ @Filename.setter
1024
+ def Filename(self, value):
1025
+ if isinstance(value, go.GoClass):
1026
+ _api.api_SourceLocation_Filename_Set(self.handle, value.handle)
1027
+ else:
1028
+ _api.api_SourceLocation_Filename_Set(self.handle, value)
1029
+ @property
1030
+ def Line(self):
1031
+ return _api.api_SourceLocation_Line_Get(self.handle)
1032
+ @Line.setter
1033
+ def Line(self, value):
1034
+ if isinstance(value, go.GoClass):
1035
+ _api.api_SourceLocation_Line_Set(self.handle, value.handle)
1036
+ else:
1037
+ _api.api_SourceLocation_Line_Set(self.handle, value)
1038
+ @property
1039
+ def Column(self):
1040
+ return _api.api_SourceLocation_Column_Get(self.handle)
1041
+ @Column.setter
1042
+ def Column(self, value):
1043
+ if isinstance(value, go.GoClass):
1044
+ _api.api_SourceLocation_Column_Set(self.handle, value.handle)
1045
+ else:
1046
+ _api.api_SourceLocation_Column_Set(self.handle, value)
1047
+
1048
+ # Python type for struct api.UnknownFunctionHandler
1049
+ class UnknownFunctionHandler(go.GoClass):
1050
+ """"""
1051
+ def __init__(self, *args, **kwargs):
1052
+ """
1053
+ handle=A Go-side object is always initialized with an explicit handle=arg
1054
+ otherwise parameters can be unnamed in order of field names or named fields
1055
+ in which case a new Go object is constructed first
1056
+ """
1057
+ if len(kwargs) == 1 and 'handle' in kwargs:
1058
+ self.handle = kwargs['handle']
1059
+ _api.IncRef(self.handle)
1060
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1061
+ self.handle = args[0].handle
1062
+ _api.IncRef(self.handle)
1063
+ else:
1064
+ self.handle = _api.api_UnknownFunctionHandler_CTor()
1065
+ _api.IncRef(self.handle)
1066
+ def __del__(self):
1067
+ _api.DecRef(self.handle)
1068
+ def __str__(self):
1069
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1070
+ sv = 'api.UnknownFunctionHandler{'
1071
+ first = True
1072
+ for v in pr:
1073
+ if callable(v[1]):
1074
+ continue
1075
+ if first:
1076
+ first = False
1077
+ else:
1078
+ sv += ', '
1079
+ sv += v[0] + '=' + str(v[1])
1080
+ return sv + '}'
1081
+ def __repr__(self):
1082
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1083
+ sv = 'api.UnknownFunctionHandler ( '
1084
+ for v in pr:
1085
+ if not callable(v[1]):
1086
+ sv += v[0] + '=' + str(v[1]) + ', '
1087
+ return sv + ')'
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))
1255
+ def GetObjectImmediateFunctions(self, id):
1256
+ """GetObjectImmediateFunctions(str id) []str, str"""
1257
+ return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateFunctions(self.handle, id))
1258
+ def GetObjectImmediateVariables(self, id):
1259
+ """GetObjectImmediateVariables(str id) []str, str"""
1260
+ return go.Slice_string(handle=_api.api_VMCompatibilityShim_GetObjectImmediateVariables(self.handle, id))
1261
+ def AddVariableToObject(self, id, variable):
1262
+ """AddVariableToObject(str id, object variable) str"""
1263
+ return _api.api_VMCompatibilityShim_AddVariableToObject(self.handle, id, variable.handle)
1264
+
1265
+ # Python type for struct api.ClassDefinition
1266
+ class ClassDefinition(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)
1280
+ else:
1281
+ self.handle = _api.api_ClassDefinition_CTor()
1282
+ _api.IncRef(self.handle)
1283
+ if 0 < len(args):
1284
+ self.Name = args[0]
1285
+ if "Name" in kwargs:
1286
+ self.Name = kwargs["Name"]
1287
+ if 1 < len(args):
1288
+ self.PublicVariables = args[1]
1289
+ if "PublicVariables" in kwargs:
1290
+ self.PublicVariables = kwargs["PublicVariables"]
1291
+ if 2 < len(args):
1292
+ self.PrivateVariables = args[2]
1293
+ if "PrivateVariables" in kwargs:
1294
+ self.PrivateVariables = kwargs["PrivateVariables"]
1295
+ if 3 < len(args):
1296
+ self.SharedVariables = args[3]
1297
+ if "SharedVariables" in kwargs:
1298
+ self.SharedVariables = kwargs["SharedVariables"]
1299
+ if 4 < len(args):
1300
+ self.PublicMethods = args[4]
1301
+ if "PublicMethods" in kwargs:
1302
+ self.PublicMethods = kwargs["PublicMethods"]
1303
+ if 5 < len(args):
1304
+ self.PrivateMethods = args[5]
1305
+ if "PrivateMethods" in kwargs:
1306
+ self.PrivateMethods = kwargs["PrivateMethods"]
1307
+ if 6 < len(args):
1308
+ self.UnknownFunctionHandler = args[6]
1309
+ if "UnknownFunctionHandler" in kwargs:
1310
+ self.UnknownFunctionHandler = kwargs["UnknownFunctionHandler"]
1311
+ def __del__(self):
1312
+ _api.DecRef(self.handle)
1313
+ def __str__(self):
1314
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1315
+ sv = 'api.ClassDefinition{'
1316
+ first = True
1317
+ for v in pr:
1318
+ if callable(v[1]):
1319
+ continue
1320
+ if first:
1321
+ first = False
1322
+ else:
1323
+ sv += ', '
1324
+ sv += v[0] + '=' + str(v[1])
1325
+ return sv + '}'
1326
+ def __repr__(self):
1327
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1328
+ sv = 'api.ClassDefinition ( '
1329
+ for v in pr:
1330
+ if not callable(v[1]):
1331
+ sv += v[0] + '=' + str(v[1]) + ', '
1332
+ return sv + ')'
1333
+ @property
1334
+ def Name(self):
1335
+ return _api.api_ClassDefinition_Name_Get(self.handle)
1336
+ @Name.setter
1337
+ def Name(self, value):
1338
+ if isinstance(value, go.GoClass):
1339
+ _api.api_ClassDefinition_Name_Set(self.handle, value.handle)
1340
+ else:
1341
+ _api.api_ClassDefinition_Name_Set(self.handle, value)
1342
+ @property
1343
+ def PublicVariables(self):
1344
+ return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_PublicVariables_Get(self.handle))
1345
+ @PublicVariables.setter
1346
+ def PublicVariables(self, value):
1347
+ if isinstance(value, go.GoClass):
1348
+ _api.api_ClassDefinition_PublicVariables_Set(self.handle, value.handle)
1349
+ else:
1350
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1351
+ @property
1352
+ def PrivateVariables(self):
1353
+ return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_PrivateVariables_Get(self.handle))
1354
+ @PrivateVariables.setter
1355
+ def PrivateVariables(self, value):
1356
+ if isinstance(value, go.GoClass):
1357
+ _api.api_ClassDefinition_PrivateVariables_Set(self.handle, value.handle)
1358
+ else:
1359
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1360
+ @property
1361
+ def SharedVariables(self):
1362
+ return Map_string_Ptr_api_ClassVariable(handle=_api.api_ClassDefinition_SharedVariables_Get(self.handle))
1363
+ @SharedVariables.setter
1364
+ def SharedVariables(self, value):
1365
+ if isinstance(value, go.GoClass):
1366
+ _api.api_ClassDefinition_SharedVariables_Set(self.handle, value.handle)
1367
+ else:
1368
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1369
+ @property
1370
+ def PublicMethods(self):
1371
+ return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PublicMethods_Get(self.handle))
1372
+ @PublicMethods.setter
1373
+ def PublicMethods(self, value):
1374
+ if isinstance(value, go.GoClass):
1375
+ _api.api_ClassDefinition_PublicMethods_Set(self.handle, value.handle)
1376
+ else:
1377
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1378
+ @property
1379
+ def PrivateMethods(self):
1380
+ return Map_string_Ptr_api_ClassMethod(handle=_api.api_ClassDefinition_PrivateMethods_Get(self.handle))
1381
+ @PrivateMethods.setter
1382
+ def PrivateMethods(self, value):
1383
+ if isinstance(value, go.GoClass):
1384
+ _api.api_ClassDefinition_PrivateMethods_Set(self.handle, value.handle)
1385
+ else:
1386
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1387
+ @property
1388
+ def UnknownFunctionHandler(self):
1389
+ return UnknownFunctionHandler(handle=_api.api_ClassDefinition_UnknownFunctionHandler_Get(self.handle))
1390
+ @UnknownFunctionHandler.setter
1391
+ def UnknownFunctionHandler(self, value):
1392
+ if isinstance(value, go.GoClass):
1393
+ _api.api_ClassDefinition_UnknownFunctionHandler_Set(self.handle, value.handle)
1394
+ else:
1395
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1396
+
1397
+ # Python type for struct api.ClassVariable
1398
+ class ClassVariable(go.GoClass):
1399
+ """"""
1400
+ def __init__(self, *args, **kwargs):
1401
+ """
1402
+ handle=A Go-side object is always initialized with an explicit handle=arg
1403
+ otherwise parameters can be unnamed in order of field names or named fields
1404
+ in which case a new Go object is constructed first
1405
+ """
1406
+ if len(kwargs) == 1 and 'handle' in kwargs:
1407
+ self.handle = kwargs['handle']
1408
+ _api.IncRef(self.handle)
1409
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1410
+ self.handle = args[0].handle
1411
+ _api.IncRef(self.handle)
1412
+ else:
1413
+ self.handle = _api.api_ClassVariable_CTor()
1414
+ _api.IncRef(self.handle)
1415
+ if 0 < len(args):
1416
+ self.Name = args[0]
1417
+ if "Name" in kwargs:
1418
+ self.Name = kwargs["Name"]
1419
+ if 1 < len(args):
1420
+ self.Value = args[1]
1421
+ if "Value" in kwargs:
1422
+ self.Value = kwargs["Value"]
1423
+ if 2 < len(args):
1424
+ self.Locked = args[2]
1425
+ if "Locked" in kwargs:
1426
+ self.Locked = kwargs["Locked"]
1427
+ def __del__(self):
1428
+ _api.DecRef(self.handle)
1429
+ def __str__(self):
1430
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1431
+ sv = 'api.ClassVariable{'
1432
+ first = True
1433
+ for v in pr:
1434
+ if callable(v[1]):
1435
+ continue
1436
+ if first:
1437
+ first = False
1438
+ else:
1439
+ sv += ', '
1440
+ sv += v[0] + '=' + str(v[1])
1441
+ return sv + '}'
1442
+ def __repr__(self):
1443
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1444
+ sv = 'api.ClassVariable ( '
1445
+ for v in pr:
1446
+ if not callable(v[1]):
1447
+ sv += v[0] + '=' + str(v[1]) + ', '
1448
+ return sv + ')'
1449
+ @property
1450
+ def Name(self):
1451
+ return _api.api_ClassVariable_Name_Get(self.handle)
1452
+ @Name.setter
1453
+ def Name(self, value):
1454
+ if isinstance(value, go.GoClass):
1455
+ _api.api_ClassVariable_Name_Set(self.handle, value.handle)
1456
+ else:
1457
+ _api.api_ClassVariable_Name_Set(self.handle, value)
1458
+ @property
1459
+ def Value(self):
1460
+ return GoValue(handle=_api.api_ClassVariable_Value_Get(self.handle))
1461
+ @Value.setter
1462
+ def Value(self, value):
1463
+ if isinstance(value, go.GoClass):
1464
+ _api.api_ClassVariable_Value_Set(self.handle, value.handle)
1465
+ else:
1466
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1467
+ @property
1468
+ def Locked(self):
1469
+ return _api.api_ClassVariable_Locked_Get(self.handle)
1470
+ @Locked.setter
1471
+ def Locked(self, value):
1472
+ if isinstance(value, go.GoClass):
1473
+ _api.api_ClassVariable_Locked_Set(self.handle, value.handle)
1474
+ else:
1475
+ _api.api_ClassVariable_Locked_Set(self.handle, value)
1476
+
1477
+ # Python type for struct api.VMConfig
1478
+ class VMConfig(go.GoClass):
1479
+ """VMConfig holds configuration options for the VM\n"""
1480
+ def __init__(self, *args, **kwargs):
1481
+ """
1482
+ handle=A Go-side object is always initialized with an explicit handle=arg
1483
+ otherwise parameters can be unnamed in order of field names or named fields
1484
+ in which case a new Go object is constructed first
1485
+ """
1486
+ if len(kwargs) == 1 and 'handle' in kwargs:
1487
+ self.handle = kwargs['handle']
1488
+ _api.IncRef(self.handle)
1489
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1490
+ self.handle = args[0].handle
1491
+ _api.IncRef(self.handle)
1492
+ else:
1493
+ self.handle = _api.api_VMConfig_CTor()
1494
+ _api.IncRef(self.handle)
1495
+ if 0 < len(args):
1496
+ self.Stdout = args[0]
1497
+ if "Stdout" in kwargs:
1498
+ self.Stdout = kwargs["Stdout"]
1499
+ if 1 < len(args):
1500
+ self.Stdin = args[1]
1501
+ if "Stdin" in kwargs:
1502
+ self.Stdin = kwargs["Stdin"]
1503
+ if 2 < len(args):
1504
+ self.Timeout = args[2]
1505
+ if "Timeout" in kwargs:
1506
+ self.Timeout = kwargs["Timeout"]
1507
+ if 3 < len(args):
1508
+ self.WorkingDirectory = args[3]
1509
+ if "WorkingDirectory" in kwargs:
1510
+ self.WorkingDirectory = kwargs["WorkingDirectory"]
1511
+ def __del__(self):
1512
+ _api.DecRef(self.handle)
1513
+ def __str__(self):
1514
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1515
+ sv = 'api.VMConfig{'
1516
+ first = True
1517
+ for v in pr:
1518
+ if callable(v[1]):
1519
+ continue
1520
+ if first:
1521
+ first = False
1522
+ else:
1523
+ sv += ', '
1524
+ sv += v[0] + '=' + str(v[1])
1525
+ return sv + '}'
1526
+ def __repr__(self):
1527
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1528
+ sv = 'api.VMConfig ( '
1529
+ for v in pr:
1530
+ if not callable(v[1]):
1531
+ sv += v[0] + '=' + str(v[1]) + ', '
1532
+ return sv + ')'
1533
+ @property
1534
+ def Stdout(self):
1535
+ """I/O configuration
1536
+ """
1537
+ return go.io_Writer(handle=_api.api_VMConfig_Stdout_Get(self.handle))
1538
+ @Stdout.setter
1539
+ def Stdout(self, value):
1540
+ if isinstance(value, go.GoClass):
1541
+ _api.api_VMConfig_Stdout_Set(self.handle, value.handle)
1542
+ else:
1543
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1544
+ @property
1545
+ def Stdin(self):
1546
+ return go.io_Reader(handle=_api.api_VMConfig_Stdin_Get(self.handle))
1547
+ @Stdin.setter
1548
+ def Stdin(self, value):
1549
+ if isinstance(value, go.GoClass):
1550
+ _api.api_VMConfig_Stdin_Set(self.handle, value.handle)
1551
+ else:
1552
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1553
+ @property
1554
+ def Timeout(self):
1555
+ """Execution configuration
1556
+ """
1557
+ return _api.api_VMConfig_Timeout_Get(self.handle)
1558
+ @Timeout.setter
1559
+ def Timeout(self, value):
1560
+ if isinstance(value, go.GoClass):
1561
+ _api.api_VMConfig_Timeout_Set(self.handle, value.handle)
1562
+ else:
1563
+ _api.api_VMConfig_Timeout_Set(self.handle, value)
1564
+ @property
1565
+ def WorkingDirectory(self):
1566
+ return _api.api_VMConfig_WorkingDirectory_Get(self.handle)
1567
+ @WorkingDirectory.setter
1568
+ def WorkingDirectory(self, value):
1569
+ if isinstance(value, go.GoClass):
1570
+ _api.api_VMConfig_WorkingDirectory_Set(self.handle, value.handle)
1571
+ else:
1572
+ _api.api_VMConfig_WorkingDirectory_Set(self.handle, value)
1573
+ def Validate(self):
1574
+ """Validate() str
1575
+
1576
+ Validate checks if the configuration is valid
1577
+ """
1578
+ return _api.api_VMConfig_Validate(self.handle)
1579
+
1580
+ # Python type for struct api.VMError
1581
+ class VMError(go.GoClass):
1582
+ """VMError represents errors that can occur in the VM API\n"""
1583
+ def __init__(self, *args, **kwargs):
1584
+ """
1585
+ handle=A Go-side object is always initialized with an explicit handle=arg
1586
+ otherwise parameters can be unnamed in order of field names or named fields
1587
+ in which case a new Go object is constructed first
1588
+ """
1589
+ if len(kwargs) == 1 and 'handle' in kwargs:
1590
+ self.handle = kwargs['handle']
1591
+ _api.IncRef(self.handle)
1592
+ elif len(args) == 1 and isinstance(args[0], go.GoClass):
1593
+ self.handle = args[0].handle
1594
+ _api.IncRef(self.handle)
1595
+ else:
1596
+ self.handle = _api.api_VMError_CTor()
1597
+ _api.IncRef(self.handle)
1598
+ if 0 < len(args):
1599
+ self.Type = args[0]
1600
+ if "Type" in kwargs:
1601
+ self.Type = kwargs["Type"]
1602
+ if 1 < len(args):
1603
+ self.Message = args[1]
1604
+ if "Message" in kwargs:
1605
+ self.Message = kwargs["Message"]
1606
+ if 2 < len(args):
1607
+ self.Source = args[2]
1608
+ if "Source" in kwargs:
1609
+ self.Source = kwargs["Source"]
1610
+ if 4 < len(args):
1611
+ self.Duration = args[4]
1612
+ if "Duration" in kwargs:
1613
+ self.Duration = kwargs["Duration"]
1614
+ def __del__(self):
1615
+ _api.DecRef(self.handle)
1616
+ def __str__(self):
1617
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1618
+ sv = 'api.VMError{'
1619
+ first = True
1620
+ for v in pr:
1621
+ if callable(v[1]):
1622
+ continue
1623
+ if first:
1624
+ first = False
1625
+ else:
1626
+ sv += ', '
1627
+ sv += v[0] + '=' + str(v[1])
1628
+ return sv + '}'
1629
+ def __repr__(self):
1630
+ pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
1631
+ sv = 'api.VMError ( '
1632
+ for v in pr:
1633
+ if not callable(v[1]):
1634
+ sv += v[0] + '=' + str(v[1]) + ', '
1635
+ return sv + ')'
1636
+ @property
1637
+ def Type(self):
1638
+ return _api.api_VMError_Type_Get(self.handle)
1639
+ @Type.setter
1640
+ def Type(self, value):
1641
+ if isinstance(value, go.GoClass):
1642
+ _api.api_VMError_Type_Set(self.handle, value.handle)
1643
+ else:
1644
+ _api.api_VMError_Type_Set(self.handle, value)
1645
+ @property
1646
+ def Message(self):
1647
+ return _api.api_VMError_Message_Get(self.handle)
1648
+ @Message.setter
1649
+ def Message(self, value):
1650
+ if isinstance(value, go.GoClass):
1651
+ _api.api_VMError_Message_Set(self.handle, value.handle)
1652
+ else:
1653
+ _api.api_VMError_Message_Set(self.handle, value)
1654
+ @property
1655
+ def Source(self):
1656
+ return SourceLocation(handle=_api.api_VMError_Source_Get(self.handle))
1657
+ @Source.setter
1658
+ def Source(self, value):
1659
+ if isinstance(value, go.GoClass):
1660
+ _api.api_VMError_Source_Set(self.handle, value.handle)
1661
+ else:
1662
+ raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
1663
+ @property
1664
+ def Duration(self):
1665
+ return _api.api_VMError_Duration_Get(self.handle)
1666
+ @Duration.setter
1667
+ def Duration(self, value):
1668
+ if isinstance(value, go.GoClass):
1669
+ _api.api_VMError_Duration_Set(self.handle, value.handle)
1670
+ else:
1671
+ _api.api_VMError_Duration_Set(self.handle, value)
1672
+ def Error(self):
1673
+ """Error() str"""
1674
+ return _api.api_VMError_Error(self.handle)
1675
+ def Unwrap(self):
1676
+ """Unwrap() str"""
1677
+ return _api.api_VMError_Unwrap(self.handle)
1678
+ def IsCompileError(self):
1679
+ """IsCompileError() bool
1680
+
1681
+ IsCompileError returns true if the error is a compilation error
1682
+ """
1683
+ return _api.api_VMError_IsCompileError(self.handle)
1684
+ def IsRuntimeError(self):
1685
+ """IsRuntimeError() bool
1686
+
1687
+ IsRuntimeError returns true if the error is a runtime error
1688
+ """
1689
+ return _api.api_VMError_IsRuntimeError(self.handle)
1690
+ def IsTimeoutError(self):
1691
+ """IsTimeoutError() bool
1692
+
1693
+ IsTimeoutError returns true if the error is a timeout error
1694
+ """
1695
+ return _api.api_VMError_IsTimeoutError(self.handle)
1696
+ def IsConversionError(self):
1697
+ """IsConversionError() bool
1698
+
1699
+ IsConversionError returns true if the error is a type conversion error
1700
+ """
1701
+ return _api.api_VMError_IsConversionError(self.handle)
1702
+ def IsConfigError(self):
1703
+ """IsConfigError() bool
1704
+
1705
+ IsConfigError returns true if the error is a configuration error
1706
+ """
1707
+ return _api.api_VMError_IsConfigError(self.handle)
1708
+
1709
+
1710
+ # ---- Slices ---
1711
+
1712
+
1713
+ # ---- Maps ---
1714
+
1715
+
1716
+ # ---- Constructors ---
1717
+ def WrapAny(value):
1718
+ """WrapAny(str value) object"""
1719
+ return GoValue(handle=_api.api_WrapAny(value))
1720
+ def WrapBool(value):
1721
+ """WrapBool(bool value) object"""
1722
+ return GoValue(handle=_api.api_WrapBool(value))
1723
+ def WrapObject(value):
1724
+ """WrapObject(object value) object"""
1725
+ return GoValue(handle=_api.api_WrapObject(value.handle))
1726
+ def ToGoValue(val):
1727
+ """ToGoValue(object val) object, str
1728
+
1729
+ ToGoValue converts an Objective-LOL value to a Go value
1730
+ """
1731
+ return GoValue(handle=_api.api_ToGoValue(val.handle))
1732
+ def WrapFloat(value):
1733
+ """WrapFloat(float value) object"""
1734
+ return GoValue(handle=_api.api_WrapFloat(value))
1735
+ def WrapInt(value):
1736
+ """WrapInt(long value) object"""
1737
+ return GoValue(handle=_api.api_WrapInt(value))
1738
+ def WrapString(value):
1739
+ """WrapString(str value) object"""
1740
+ return GoValue(handle=_api.api_WrapString(value))
1741
+ def NewVM(config):
1742
+ """NewVM(object config) object, str
1743
+
1744
+ NewVM creates a new VM instance with the given config
1745
+ """
1746
+ return VM(handle=_api.api_NewVM(config.handle))
1747
+ def NewClassDefinition():
1748
+ """NewClassDefinition() object"""
1749
+ return ClassDefinition(handle=_api.api_NewClassDefinition())
1750
+ def DefaultConfig():
1751
+ """DefaultConfig() object
1752
+
1753
+ DefaultConfig returns a default configuration
1754
+ """
1755
+ return VMConfig(handle=_api.api_DefaultConfig())
1756
+ def NewConversionError(message, wrapped):
1757
+ """NewConversionError(str message, str wrapped) object
1758
+
1759
+ NewConversionError creates a new type conversion error
1760
+ """
1761
+ return VMError(handle=_api.api_NewConversionError(message, wrapped))
1762
+ def NewCompileError(message, source):
1763
+ """NewCompileError(str message, object source) object
1764
+
1765
+ NewCompileError creates a new compile error
1766
+ """
1767
+ return VMError(handle=_api.api_NewCompileError(message, source.handle))
1768
+ def NewConfigError(message, wrapped):
1769
+ """NewConfigError(str message, str wrapped) object
1770
+
1771
+ NewConfigError creates a new configuration error
1772
+ """
1773
+ return VMError(handle=_api.api_NewConfigError(message, wrapped))
1774
+ def NewTimeoutError(duration):
1775
+ """NewTimeoutError(long duration) object
1776
+
1777
+ NewTimeoutError creates a new timeout error
1778
+ """
1779
+ return VMError(handle=_api.api_NewTimeoutError(duration))
1780
+ def NewRuntimeError(message, source):
1781
+ """NewRuntimeError(str message, object source) object
1782
+
1783
+ NewRuntimeError creates a new runtime error
1784
+ """
1785
+ return VMError(handle=_api.api_NewRuntimeError(message, source.handle))
1786
+
1787
+
1788
+ # ---- Functions ---
1789
+ def FromGoValue(val):
1790
+ """FromGoValue(object val) object, str
1791
+
1792
+ FromGoValue converts a Go value to an Objective-LOL value
1793
+ """
1794
+ return go.environment_Value(handle=_api.api_FromGoValue(val.handle))
1795
+ def LookupObject(id):
1796
+ """LookupObject(str id) object, str"""
1797
+ return go.Ptr_environment_ObjectInstance(handle=_api.api_LookupObject(id))
1798
+ def ConvertArguments(args):
1799
+ """ConvertArguments([]object args) []object, str
1800
+
1801
+ ConvertArguments converts a slice of Go values to Objective-LOL values
1802
+ """
1803
+ return Slice_environment_Value(handle=_api.api_ConvertArguments(args.handle))
1804
+
1805
+