You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.9 KiB

  1. #!/usr/bin/env python
  2. from __future__ import print_function
  3. import sys
  4. sys.path.append('.')
  5. from example import MyObject1
  6. from example import MyObject2
  7. from example import MyObject3
  8. from example import make_object_1
  9. from example import make_object_2
  10. from example import make_myobject1_1
  11. from example import make_myobject1_2
  12. from example import make_myobject2_1
  13. from example import make_myobject2_2
  14. from example import make_myobject3_1
  15. from example import make_myobject3_2
  16. from example import print_object_1
  17. from example import print_object_2
  18. from example import print_object_3
  19. from example import print_object_4
  20. from example import print_myobject1_1
  21. from example import print_myobject1_2
  22. from example import print_myobject1_3
  23. from example import print_myobject1_4
  24. from example import print_myobject2_1
  25. from example import print_myobject2_2
  26. from example import print_myobject2_3
  27. from example import print_myobject2_4
  28. from example import print_myobject3_1
  29. from example import print_myobject3_2
  30. from example import print_myobject3_3
  31. from example import print_myobject3_4
  32. for o in [make_object_1(), make_object_2(), MyObject1(3)]:
  33. print("Reference count = %i" % o.getRefCount())
  34. print_object_1(o)
  35. print_object_2(o)
  36. print_object_3(o)
  37. print_object_4(o)
  38. for o in [make_myobject1_1(), make_myobject1_2(), MyObject1(6), 7]:
  39. print(o)
  40. if not isinstance(o, int):
  41. print_object_1(o)
  42. print_object_2(o)
  43. print_object_3(o)
  44. print_object_4(o)
  45. print_myobject1_1(o)
  46. print_myobject1_2(o)
  47. print_myobject1_3(o)
  48. print_myobject1_4(o)
  49. for o in [MyObject2(8), make_myobject2_1(), make_myobject2_2()]:
  50. print(o)
  51. print_myobject2_1(o)
  52. print_myobject2_2(o)
  53. print_myobject2_3(o)
  54. print_myobject2_4(o)
  55. for o in [MyObject3(9), make_myobject3_1(), make_myobject3_2()]:
  56. print(o)
  57. print_myobject3_1(o)
  58. print_myobject3_2(o)
  59. print_myobject3_3(o)
  60. print_myobject3_4(o)