-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.py
More file actions
62 lines (53 loc) · 1.84 KB
/
Copy pathsample.py
File metadata and controls
62 lines (53 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from py_bugengine import *
p = Plugin("sample.python")
print(p.BugEngine.TestCases.Enum.Value1)
print(p.BugEngine.TestCases.Enum.Value2)
print(p.BugEngine.TestCases.Enum.Value3)
def name(type):
constness = int(type.constness) == 0 and 'const ' or ''
access = int(type.access) == 0 and 'const ' or ''
if type.indirection == 0:
return '%s%s' % (access, type.metaclass.name)
else:
if type.indirection == 1:
ptr = 'raw'
elif type.indirection == 2:
ptr = 'weak'
elif type.indirection == 3:
ptr = 'ref'
else:
ptr = '???'
return '%s%s<%s%s>' % (constness, ptr, access, type.metaclass.name)
def help(klass):
def print_method(method):
for overload in method.overloads:
param_list = []
for param in overload.params:
param_list.append((name(param.type), param.name))
print(
' %s %s (%s)' % (name(overload.returnType), method.name, ', '.join(('%s %s' % p for p in param_list)))
)
print('class %s' % klass.name)
if klass.constructor:
print('List of constructors:')
print_method(klass.constructor)
print('List of methods:')
for method in klass.methods:
print_method(method)
print('List of properties:')
for property in klass.properties:
print(' ', name(property.type), property.name)
print('List of objects:')
object = klass.objects
while object:
print(' ', object.name)
object = object.next
if __name__ == '__main__':
help(BugEngine.RTTI.Class.ClassType.metaclass)
help(BugEngine.RTTI.Class)
help(BugEngine.text)
help(BugEngine.DiskFolder)
sample = Plugin('sample.python')
c = sample.TestCases.Class(y1=1, x1=3)
c.doStuff(1, 2, True)
print('%d - %d' % (c.x1, c.y1))