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