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