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