2015-09-04 21:42:12 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from __future__ import print_function
|
2015-07-05 18:05:44 +00:00
|
|
|
import sys
|
|
|
|
sys.path.append('.')
|
|
|
|
|
2016-01-17 21:36:40 +00:00
|
|
|
from example import MyObject1
|
|
|
|
from example import MyObject2
|
|
|
|
from example import MyObject3
|
|
|
|
|
2015-07-05 18:05:44 +00:00
|
|
|
from example import make_object_1
|
|
|
|
from example import make_object_2
|
2016-01-17 21:36:40 +00:00
|
|
|
from example import make_myobject1_1
|
|
|
|
from example import make_myobject1_2
|
2015-11-24 22:05:58 +00:00
|
|
|
from example import make_myobject2_1
|
|
|
|
from example import make_myobject2_2
|
2016-01-17 21:36:40 +00:00
|
|
|
from example import make_myobject3_1
|
|
|
|
from example import make_myobject3_2
|
|
|
|
|
2015-07-05 18:05:44 +00:00
|
|
|
from example import print_object_1
|
|
|
|
from example import print_object_2
|
|
|
|
from example import print_object_3
|
|
|
|
from example import print_object_4
|
2016-01-17 21:36:40 +00:00
|
|
|
|
|
|
|
from example import print_myobject1_1
|
|
|
|
from example import print_myobject1_2
|
|
|
|
from example import print_myobject1_3
|
|
|
|
from example import print_myobject1_4
|
|
|
|
|
2015-11-24 22:05:58 +00:00
|
|
|
from example import print_myobject2_1
|
|
|
|
from example import print_myobject2_2
|
|
|
|
from example import print_myobject2_3
|
|
|
|
from example import print_myobject2_4
|
2015-07-05 18:05:44 +00:00
|
|
|
|
2016-01-17 21:36:40 +00:00
|
|
|
from example import print_myobject3_1
|
|
|
|
from example import print_myobject3_2
|
|
|
|
from example import print_myobject3_3
|
|
|
|
from example import print_myobject3_4
|
|
|
|
|
|
|
|
for o in [make_object_1(), make_object_2(), MyObject1(3)]:
|
2015-07-05 18:05:44 +00:00
|
|
|
print("Reference count = %i" % o.getRefCount())
|
|
|
|
print_object_1(o)
|
|
|
|
print_object_2(o)
|
|
|
|
print_object_3(o)
|
|
|
|
print_object_4(o)
|
|
|
|
|
2016-01-17 21:36:40 +00:00
|
|
|
for o in [make_myobject1_1(), make_myobject1_2(), MyObject1(6), 7]:
|
2015-07-05 18:05:44 +00:00
|
|
|
print(o)
|
|
|
|
if not isinstance(o, int):
|
|
|
|
print_object_1(o)
|
|
|
|
print_object_2(o)
|
|
|
|
print_object_3(o)
|
|
|
|
print_object_4(o)
|
2016-01-17 21:36:40 +00:00
|
|
|
print_myobject1_1(o)
|
|
|
|
print_myobject1_2(o)
|
|
|
|
print_myobject1_3(o)
|
|
|
|
print_myobject1_4(o)
|
2015-11-24 22:05:58 +00:00
|
|
|
|
2016-01-17 21:36:40 +00:00
|
|
|
for o in [MyObject2(8), make_myobject2_1(), make_myobject2_2()]:
|
2015-11-24 22:05:58 +00:00
|
|
|
print(o)
|
|
|
|
print_myobject2_1(o)
|
|
|
|
print_myobject2_2(o)
|
|
|
|
print_myobject2_3(o)
|
|
|
|
print_myobject2_4(o)
|
2016-01-17 21:36:40 +00:00
|
|
|
|
|
|
|
for o in [MyObject3(9), make_myobject3_1(), make_myobject3_2()]:
|
|
|
|
print(o)
|
|
|
|
print_myobject3_1(o)
|
|
|
|
print_myobject3_2(o)
|
|
|
|
print_myobject3_3(o)
|
|
|
|
print_myobject3_4(o)
|