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