objective-lol 0.0.1__cp312-cp312-win_amd64.whl

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