libv8 7.8.279.23.0beta1 → 8.4.255.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (719) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +11 -14
  4. data/CHANGELOG.md +7 -1
  5. data/README.md +10 -11
  6. data/Rakefile +30 -36
  7. data/ext/libv8/builder.rb +2 -1
  8. data/lib/libv8/version.rb +1 -1
  9. data/libv8.gemspec +1 -3
  10. data/vendor/depot_tools/{cipd.ps1 → .cipd_impl.ps1} +0 -0
  11. data/vendor/depot_tools/.gitattributes +1 -1
  12. data/vendor/depot_tools/.gitignore +3 -1
  13. data/vendor/depot_tools/.style.yapf +3 -1
  14. data/vendor/depot_tools/.vpython +55 -0
  15. data/vendor/depot_tools/.vpython3 +23 -0
  16. data/vendor/depot_tools/CROS_OWNERS +3 -1
  17. data/vendor/depot_tools/GOMA_OWNERS +9 -0
  18. data/vendor/depot_tools/LUCI_OWNERS +5 -0
  19. data/vendor/depot_tools/OWNERS +21 -6
  20. data/vendor/depot_tools/PRESUBMIT.py +35 -18
  21. data/vendor/depot_tools/README.git-cl.md +0 -14
  22. data/vendor/depot_tools/README.md +1 -1
  23. data/vendor/depot_tools/WATCHLISTS +2 -2
  24. data/vendor/depot_tools/auth.py +60 -772
  25. data/vendor/depot_tools/autoninja +12 -6
  26. data/vendor/depot_tools/autoninja.bat +6 -6
  27. data/vendor/depot_tools/autoninja.py +64 -27
  28. data/vendor/depot_tools/bb +1 -1
  29. data/vendor/depot_tools/bootstrap/{win/README.md → README.md} +28 -14
  30. data/vendor/depot_tools/bootstrap/{win/win_tools.py → bootstrap.py} +60 -43
  31. data/vendor/depot_tools/bootstrap/{win/git-bash.template.sh → git-bash.template.sh} +1 -1
  32. data/vendor/depot_tools/bootstrap/{win/git.template.bat → git.template.bat} +0 -0
  33. data/vendor/depot_tools/bootstrap/manifest.txt +27 -0
  34. data/vendor/depot_tools/bootstrap/manifest_bleeding_edge.txt +27 -0
  35. data/vendor/depot_tools/bootstrap/{win/profile.d.python.sh → profile.d.python.sh} +0 -0
  36. data/vendor/depot_tools/bootstrap/{win/python27.bleeding_edge.bat → python27.bat} +0 -0
  37. data/vendor/depot_tools/bootstrap/{win/python27.new.bat → python3.bat} +3 -3
  38. data/vendor/depot_tools/bootstrap/{win/win_tools.bat → win_tools.bat} +21 -16
  39. data/vendor/depot_tools/bootstrap_python3 +35 -0
  40. data/vendor/depot_tools/cbuildbot +1 -1
  41. data/vendor/depot_tools/chrome_set_ver +1 -1
  42. data/vendor/depot_tools/cipd +43 -39
  43. data/vendor/depot_tools/cipd.bat +2 -2
  44. data/vendor/depot_tools/cipd_client_version +1 -1
  45. data/vendor/depot_tools/cipd_client_version.digests +15 -14
  46. data/vendor/depot_tools/cipd_manifest.txt +31 -8
  47. data/vendor/depot_tools/cipd_manifest.versions +278 -158
  48. data/vendor/depot_tools/cit.py +9 -7
  49. data/vendor/depot_tools/clang_format.py +4 -1
  50. data/vendor/depot_tools/clang_format_merge_driver.py +10 -8
  51. data/vendor/depot_tools/compile_single_file.py +7 -2
  52. data/vendor/depot_tools/cpplint.py +51 -45
  53. data/vendor/depot_tools/cros +87 -0
  54. data/vendor/depot_tools/cros_sdk +1 -1
  55. data/vendor/depot_tools/crosjobs +13 -0
  56. data/vendor/depot_tools/detect_host_arch.py +0 -1
  57. data/vendor/depot_tools/dirmd +12 -0
  58. data/vendor/depot_tools/dirmd.bat +7 -0
  59. data/vendor/depot_tools/download_from_google_storage.py +47 -27
  60. data/vendor/depot_tools/ensure_bootstrap +14 -0
  61. data/vendor/depot_tools/fetch +14 -1
  62. data/vendor/depot_tools/fetch.bat +14 -1
  63. data/vendor/depot_tools/fetch.py +5 -7
  64. data/vendor/depot_tools/fetch_configs/chromium.py +6 -4
  65. data/vendor/depot_tools/fetch_configs/devtools-frontend.py +44 -0
  66. data/vendor/depot_tools/fetch_configs/ios_internal.py +10 -19
  67. data/vendor/depot_tools/fix_encoding.py +19 -5
  68. data/vendor/depot_tools/gclient +28 -12
  69. data/vendor/depot_tools/gclient-new-workdir.py +2 -0
  70. data/vendor/depot_tools/gclient.bat +18 -1
  71. data/vendor/depot_tools/gclient.py +156 -118
  72. data/vendor/depot_tools/gclient_eval.py +119 -107
  73. data/vendor/depot_tools/gclient_paths.py +67 -57
  74. data/vendor/depot_tools/gclient_scm.py +180 -169
  75. data/vendor/depot_tools/gclient_utils.py +177 -124
  76. data/vendor/depot_tools/gerrit_client.py +21 -13
  77. data/vendor/depot_tools/gerrit_util.py +188 -228
  78. data/vendor/depot_tools/git-cache +1 -1
  79. data/vendor/depot_tools/git-cl +1 -1
  80. data/vendor/depot_tools/git-drover +1 -1
  81. data/vendor/depot_tools/git-find-releases +1 -1
  82. data/vendor/depot_tools/git-footers +1 -1
  83. data/vendor/depot_tools/git-freeze +1 -1
  84. data/vendor/depot_tools/git-hyper-blame +1 -1
  85. data/vendor/depot_tools/git-map +1 -1
  86. data/vendor/depot_tools/git-map-branches +1 -1
  87. data/vendor/depot_tools/git-mark-merge-base +1 -1
  88. data/vendor/depot_tools/git-nav-downstream +1 -1
  89. data/vendor/depot_tools/git-new-branch +1 -1
  90. data/vendor/depot_tools/git-number +1 -1
  91. data/vendor/depot_tools/git-rebase-update +1 -1
  92. data/vendor/depot_tools/git-rename-branch +1 -1
  93. data/vendor/depot_tools/git-reparent-branch +1 -1
  94. data/vendor/depot_tools/git-retry +1 -1
  95. data/vendor/depot_tools/git-squash-branch +1 -1
  96. data/vendor/depot_tools/git-thaw +1 -1
  97. data/vendor/depot_tools/git-upstream-diff +1 -1
  98. data/vendor/depot_tools/git_cache.py +195 -281
  99. data/vendor/depot_tools/git_cl.py +1506 -2075
  100. data/vendor/depot_tools/git_cl_completion.sh +16 -2
  101. data/vendor/depot_tools/git_common.py +77 -32
  102. data/vendor/depot_tools/git_drover.py +17 -8
  103. data/vendor/depot_tools/git_find_releases.py +11 -9
  104. data/vendor/depot_tools/git_footers.py +13 -9
  105. data/vendor/depot_tools/git_freezer.py +3 -1
  106. data/vendor/depot_tools/git_hyper_blame.py +25 -32
  107. data/vendor/depot_tools/git_map.py +115 -93
  108. data/vendor/depot_tools/git_map_branches.py +11 -10
  109. data/vendor/depot_tools/git_mark_merge_base.py +8 -6
  110. data/vendor/depot_tools/git_nav_downstream.py +9 -6
  111. data/vendor/depot_tools/git_new_branch.py +39 -33
  112. data/vendor/depot_tools/git_number.py +28 -17
  113. data/vendor/depot_tools/git_rebase_update.py +50 -49
  114. data/vendor/depot_tools/git_rename_branch.py +2 -2
  115. data/vendor/depot_tools/git_reparent_branch.py +8 -6
  116. data/vendor/depot_tools/git_upstream_diff.py +4 -2
  117. data/vendor/depot_tools/gn.py +6 -4
  118. data/vendor/depot_tools/goma_auth +12 -0
  119. data/vendor/depot_tools/goma_auth.bat +8 -0
  120. data/vendor/depot_tools/goma_ctl +12 -0
  121. data/vendor/depot_tools/goma_ctl.bat +8 -0
  122. data/vendor/depot_tools/gsutil.py +5 -2
  123. data/vendor/depot_tools/gsutil.py.bat +8 -0
  124. data/vendor/depot_tools/gsutil.vpython +3 -1
  125. data/vendor/depot_tools/infra/config/OWNERS +2 -2
  126. data/vendor/depot_tools/infra/config/recipes.cfg +3 -2
  127. data/vendor/depot_tools/led +1 -1
  128. data/vendor/depot_tools/lockfile.py +116 -0
  129. data/vendor/depot_tools/luci-auth +1 -1
  130. data/vendor/depot_tools/lucicfg +1 -1
  131. data/vendor/depot_tools/mac_toolchain +1 -1
  132. data/vendor/depot_tools/man/html/depot_tools.html +1 -1
  133. data/vendor/depot_tools/man/html/depot_tools_tutorial.html +31 -25
  134. data/vendor/depot_tools/man/html/git-cl.html +1 -1
  135. data/vendor/depot_tools/man/html/git-drover.html +18 -18
  136. data/vendor/depot_tools/man/html/git-footers.html +1 -1
  137. data/vendor/depot_tools/man/html/git-freeze.html +3 -3
  138. data/vendor/depot_tools/man/html/git-hyper-blame.html +1 -1
  139. data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
  140. data/vendor/depot_tools/man/html/git-map.html +1 -1
  141. data/vendor/depot_tools/man/html/git-mark-merge-base.html +1 -1
  142. data/vendor/depot_tools/man/html/git-nav-downstream.html +3 -3
  143. data/vendor/depot_tools/man/html/git-nav-upstream.html +12 -6
  144. data/vendor/depot_tools/man/html/git-new-branch.html +1 -1
  145. data/vendor/depot_tools/man/html/git-rebase-update.html +20 -1
  146. data/vendor/depot_tools/man/html/git-rename-branch.html +1 -1
  147. data/vendor/depot_tools/man/html/git-reparent-branch.html +1 -1
  148. data/vendor/depot_tools/man/html/git-retry.html +1 -1
  149. data/vendor/depot_tools/man/html/git-squash-branch.html +1 -1
  150. data/vendor/depot_tools/man/html/git-thaw.html +1 -1
  151. data/vendor/depot_tools/man/html/git-upstream-diff.html +10 -6
  152. data/vendor/depot_tools/man/man1/git-cl.1 +4 -4
  153. data/vendor/depot_tools/man/man1/git-drover.1 +21 -21
  154. data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
  155. data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
  156. data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
  157. data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
  158. data/vendor/depot_tools/man/man1/git-map.1 +4 -4
  159. data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
  160. data/vendor/depot_tools/man/man1/git-nav-downstream.1 +6 -6
  161. data/vendor/depot_tools/man/man1/git-nav-upstream.1 +15 -9
  162. data/vendor/depot_tools/man/man1/git-new-branch.1 +3 -3
  163. data/vendor/depot_tools/man/man1/git-rebase-update.1 +14 -4
  164. data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
  165. data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
  166. data/vendor/depot_tools/man/man1/git-retry.1 +4 -4
  167. data/vendor/depot_tools/man/man1/git-squash-branch.1 +4 -4
  168. data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
  169. data/vendor/depot_tools/man/man1/git-upstream-diff.1 +7 -13
  170. data/vendor/depot_tools/man/man7/depot_tools.7 +4 -4
  171. data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +31 -25
  172. data/vendor/depot_tools/man/src/common_demo_functions.sh +2 -2
  173. data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +3 -3
  174. data/vendor/depot_tools/man/src/filter_demo_output.py +3 -1
  175. data/vendor/depot_tools/man/src/git-new-branch.txt +2 -1
  176. data/vendor/depot_tools/man/src/git-rebase-update.txt +8 -1
  177. data/vendor/depot_tools/metrics.README.md +5 -2
  178. data/vendor/depot_tools/metrics.py +4 -4
  179. data/vendor/depot_tools/metrics_utils.py +3 -3
  180. data/vendor/depot_tools/my_activity.py +85 -251
  181. data/vendor/depot_tools/ninja +1 -0
  182. data/vendor/depot_tools/ninja-mac +0 -0
  183. data/vendor/depot_tools/ninjalog_uploader.py +146 -145
  184. data/vendor/depot_tools/ninjalog_uploader_wrapper.py +69 -60
  185. data/vendor/depot_tools/owners.py +57 -21
  186. data/vendor/depot_tools/owners_finder.py +28 -14
  187. data/vendor/depot_tools/post_build_ninja_summary.py +76 -48
  188. data/vendor/depot_tools/presubmit_canned_checks.py +293 -106
  189. data/vendor/depot_tools/presubmit_support.py +527 -333
  190. data/vendor/depot_tools/prpc +1 -1
  191. data/vendor/depot_tools/pylint +2 -12
  192. data/vendor/depot_tools/pylint-1.5 +78 -0
  193. data/vendor/depot_tools/pylint-1.6 +78 -0
  194. data/vendor/depot_tools/pylint-1.7 +78 -0
  195. data/vendor/depot_tools/pylint-1.8 +78 -0
  196. data/vendor/depot_tools/pylint-1.9 +78 -0
  197. data/vendor/depot_tools/{depot-tools-auth.bat → pylint.bat} +2 -2
  198. data/vendor/depot_tools/pylint_main.py +45 -0
  199. data/vendor/depot_tools/pylintrc +14 -1
  200. data/vendor/depot_tools/python-bin/python3 +7 -0
  201. data/vendor/depot_tools/python_runner.sh +13 -8
  202. data/vendor/depot_tools/rdb +12 -0
  203. data/vendor/depot_tools/rdb.bat +7 -0
  204. data/vendor/depot_tools/recipes/OWNERS +0 -1
  205. data/vendor/depot_tools/recipes/README.recipes.md +215 -151
  206. data/vendor/depot_tools/recipes/recipe_modules/OWNERS +1 -1
  207. data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +17 -17
  208. data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +65 -32
  209. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +12 -4
  210. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +11 -3
  211. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +12 -4
  212. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +22 -8
  213. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +27 -9
  214. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +22 -8
  215. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +22 -8
  216. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/input_commit_with_id_without_repo.json +22 -8
  217. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/multiple_patch_refs.json +22 -8
  218. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +27 -9
  219. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json +12 -4
  220. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_branch_head.json +10 -4
  221. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json +12 -4
  222. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_master.json +10 -4
  223. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/refs.json +22 -8
  224. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +22 -8
  225. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json +117 -0
  226. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +16 -10
  227. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +34 -10
  228. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +16 -10
  229. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +27 -9
  230. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +27 -9
  231. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +27 -9
  232. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +27 -9
  233. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +27 -9
  234. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +27 -9
  235. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +27 -9
  236. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +0 -5
  237. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +22 -8
  238. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +7 -23
  239. data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +187 -114
  240. data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +2 -2
  241. data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/do_not_retry_patch_failures_in_cq.py +42 -0
  242. data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/ensure_checkout.py +1 -0
  243. data/vendor/depot_tools/recipes/recipe_modules/cipd/__init__.py +0 -1
  244. data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +2 -2
  245. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic.json +0 -1
  246. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic_pkg.json +0 -1
  247. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +2 -4
  248. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-many-instances.json +0 -1
  249. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/mac64.json +0 -1
  250. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +26 -6
  251. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +23 -5
  252. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +23 -5
  253. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/win64.json +0 -1
  254. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +0 -1
  255. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +0 -1
  256. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +0 -1
  257. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +0 -1
  258. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +0 -1
  259. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +0 -1
  260. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +0 -1
  261. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +0 -1
  262. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +0 -1
  263. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +0 -1
  264. data/vendor/depot_tools/recipes/recipe_modules/cipd/test_api.py +1 -1
  265. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +4 -1
  266. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic.json +4 -2
  267. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic_luci.json +3 -1
  268. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/win.json +4 -2
  269. data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +2 -1
  270. data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +82 -13
  271. data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +21 -9
  272. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +3 -4
  273. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +3 -6
  274. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +3 -4
  275. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +7 -7
  276. data/vendor/depot_tools/recipes/recipe_modules/gclient/resources/diff_deps.py +16 -0
  277. data/vendor/depot_tools/recipes/recipe_modules/gclient/test_api.py +4 -0
  278. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/basic.json +55 -0
  279. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/dont have revision yet.json +84 -0
  280. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/no change, exception.json +83 -0
  281. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/windows.json +55 -0
  282. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.py +88 -0
  283. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +9 -21
  284. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/sync_failure.py +24 -0
  285. data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +2 -1
  286. data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +7 -12
  287. data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +0 -2
  288. data/vendor/depot_tools/recipes/recipe_modules/git/api.py +9 -17
  289. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic.json +2 -8
  290. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +2 -8
  291. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +2 -8
  292. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +2 -8
  293. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +2 -8
  294. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +2 -8
  295. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +2 -8
  296. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +3 -13
  297. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +2 -8
  298. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +4 -12
  299. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +2 -10
  300. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +1 -7
  301. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +1 -7
  302. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +0 -8
  303. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +3 -10
  304. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +3 -11
  305. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +2 -8
  306. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +3 -13
  307. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +2 -8
  308. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +2 -8
  309. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.py +0 -5
  310. data/vendor/depot_tools/recipes/recipe_modules/git_cl/__init__.py +1 -1
  311. data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +7 -13
  312. data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +21 -16
  313. data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.py +1 -2
  314. data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +1 -1
  315. data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +0 -1
  316. data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +2 -2
  317. data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.expected/basic.json +0 -1
  318. data/vendor/depot_tools/recipes/recipe_modules/gsutil/api.py +23 -8
  319. data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.expected/basic.json +52 -1
  320. data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.py +15 -0
  321. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/__init__.py +1 -0
  322. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/api.py +32 -8
  323. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/ancient_version.json +83 -0
  324. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/automatic_version.json +83 -0
  325. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/explicit_version.json +83 -0
  326. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json +0 -1
  327. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/mac.json +5 -4
  328. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/win.json +0 -1
  329. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.py +21 -2
  330. data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +20 -0
  331. data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +235 -3
  332. data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +13 -5
  333. data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.py +5 -1
  334. data/vendor/depot_tools/recipes/recipe_modules/presubmit/properties.proto +14 -0
  335. data/vendor/depot_tools/recipes/recipe_modules/presubmit/test_api.py +19 -0
  336. data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/execute.py +247 -0
  337. data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/prepare.py +49 -0
  338. data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +33 -45
  339. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json +0 -1
  340. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +64 -21
  341. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +64 -21
  342. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +1 -22
  343. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +1 -22
  344. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +5 -32
  345. data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py +29 -0
  346. data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.expected/basic.json +5 -0
  347. data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py +22 -0
  348. data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py +32 -0
  349. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json +0 -1
  350. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json +0 -1
  351. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +2 -1
  352. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.py +1 -6
  353. data/vendor/depot_tools/recipes/recipes.py +49 -28
  354. data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +11 -6
  355. data/vendor/depot_tools/repo +698 -540
  356. data/vendor/depot_tools/roll-dep +14 -1
  357. data/vendor/depot_tools/roll-dep.bat +10 -1
  358. data/vendor/depot_tools/roll_dep.py +15 -10
  359. data/vendor/depot_tools/scm.py +94 -74
  360. data/vendor/depot_tools/setup_color.py +36 -2
  361. data/vendor/depot_tools/split_cl.py +44 -32
  362. data/vendor/depot_tools/subcommand.py +6 -6
  363. data/vendor/depot_tools/subprocess2.py +38 -322
  364. data/vendor/depot_tools/third_party/colorama/LICENSE.txt +0 -1
  365. data/vendor/depot_tools/third_party/colorama/README.chromium +4 -5
  366. data/vendor/depot_tools/third_party/colorama/README.rst +346 -0
  367. data/vendor/depot_tools/third_party/colorama/__init__.py +3 -4
  368. data/vendor/depot_tools/third_party/colorama/ansi.py +82 -30
  369. data/vendor/depot_tools/third_party/colorama/ansitowin32.py +105 -37
  370. data/vendor/depot_tools/third_party/colorama/initialise.py +39 -15
  371. data/vendor/depot_tools/third_party/colorama/win32.py +46 -28
  372. data/vendor/depot_tools/third_party/colorama/winterm.py +80 -31
  373. data/vendor/depot_tools/update_depot_tools +18 -8
  374. data/vendor/depot_tools/update_depot_tools.bat +19 -15
  375. data/vendor/depot_tools/upload_metrics.py +7 -6
  376. data/vendor/depot_tools/upload_to_google_storage.py +22 -15
  377. data/vendor/depot_tools/vpython +4 -4
  378. data/vendor/depot_tools/vpython.bat +1 -1
  379. data/vendor/depot_tools/vpython3 +55 -0
  380. data/vendor/depot_tools/vpython3.bat +12 -0
  381. data/vendor/depot_tools/watchlists.py +14 -11
  382. data/vendor/depot_tools/weekly +4 -2
  383. data/vendor/depot_tools/win32imports.py +61 -0
  384. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +49 -41
  385. data/vendor/depot_tools/win_toolchain/package_from_installed.py +142 -149
  386. data/vendor/depot_tools/wtf +5 -3
  387. data/vendor/depot_tools/yapf +5 -1
  388. metadata +66 -345
  389. data/vendor/depot_tools/README.testing +0 -23
  390. data/vendor/depot_tools/annotated_gclient.py +0 -89
  391. data/vendor/depot_tools/appengine_mapper.py +0 -23
  392. data/vendor/depot_tools/bootstrap/win/manifest.txt +0 -20
  393. data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +0 -20
  394. data/vendor/depot_tools/bootstrap/win/pylint.new.bat +0 -7
  395. data/vendor/depot_tools/buildbucket.py +0 -186
  396. data/vendor/depot_tools/checkout.py +0 -431
  397. data/vendor/depot_tools/cros +0 -1
  398. data/vendor/depot_tools/dart_format.py +0 -58
  399. data/vendor/depot_tools/depot-tools-auth +0 -8
  400. data/vendor/depot_tools/depot-tools-auth.py +0 -102
  401. data/vendor/depot_tools/my_reviews.py +0 -396
  402. data/vendor/depot_tools/patch.py +0 -548
  403. data/vendor/depot_tools/pylint.py +0 -30
  404. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json +0 -48
  405. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +0 -239
  406. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_luci.json +0 -222
  407. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/__init__.py +0 -4
  408. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/api.py +0 -29
  409. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/basic.json +0 -15
  410. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_linux.json +0 -15
  411. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_mac.json +0 -15
  412. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_win.json +0 -15
  413. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_linux.json +0 -15
  414. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_mac.json +0 -15
  415. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_win.json +0 -15
  416. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_linux.json +0 -15
  417. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_mac.json +0 -15
  418. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_win.json +0 -15
  419. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.py +0 -33
  420. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/path_config.py +0 -66
  421. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/set_failure_hash_with_no_steps.json +0 -11
  422. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch.json +0 -45
  423. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch_luci.json +0 -45
  424. data/vendor/depot_tools/rietveld.py +0 -779
  425. data/vendor/depot_tools/roll-dep-svn +0 -8
  426. data/vendor/depot_tools/roll-dep-svn.bat +0 -12
  427. data/vendor/depot_tools/roll_dep_svn.py +0 -430
  428. data/vendor/depot_tools/support/chromite_wrapper +0 -96
  429. data/vendor/depot_tools/third_party/boto/LICENSE +0 -18
  430. data/vendor/depot_tools/third_party/boto/README.chromium +0 -43
  431. data/vendor/depot_tools/third_party/boto/README.rst +0 -163
  432. data/vendor/depot_tools/third_party/boto/__init__.py +0 -793
  433. data/vendor/depot_tools/third_party/boto/auth.py +0 -682
  434. data/vendor/depot_tools/third_party/boto/auth_handler.py +0 -58
  435. data/vendor/depot_tools/third_party/boto/cacerts/__init__.py +0 -22
  436. data/vendor/depot_tools/third_party/boto/cacerts/cacerts.txt +0 -2183
  437. data/vendor/depot_tools/third_party/boto/compat.py +0 -28
  438. data/vendor/depot_tools/third_party/boto/connection.py +0 -1081
  439. data/vendor/depot_tools/third_party/boto/contrib/__init__.py +0 -22
  440. data/vendor/depot_tools/third_party/boto/contrib/ymlmessage.py +0 -52
  441. data/vendor/depot_tools/third_party/boto/core/README +0 -58
  442. data/vendor/depot_tools/third_party/boto/core/__init__.py +0 -23
  443. data/vendor/depot_tools/third_party/boto/core/auth.py +0 -78
  444. data/vendor/depot_tools/third_party/boto/core/credentials.py +0 -154
  445. data/vendor/depot_tools/third_party/boto/core/dictresponse.py +0 -178
  446. data/vendor/depot_tools/third_party/boto/core/service.py +0 -67
  447. data/vendor/depot_tools/third_party/boto/datapipeline/__init__.py +0 -0
  448. data/vendor/depot_tools/third_party/boto/datapipeline/exceptions.py +0 -42
  449. data/vendor/depot_tools/third_party/boto/datapipeline/layer1.py +0 -546
  450. data/vendor/depot_tools/third_party/boto/ecs/__init__.py +0 -90
  451. data/vendor/depot_tools/third_party/boto/ecs/item.py +0 -153
  452. data/vendor/depot_tools/third_party/boto/exception.py +0 -476
  453. data/vendor/depot_tools/third_party/boto/file/README +0 -49
  454. data/vendor/depot_tools/third_party/boto/file/__init__.py +0 -28
  455. data/vendor/depot_tools/third_party/boto/file/bucket.py +0 -112
  456. data/vendor/depot_tools/third_party/boto/file/connection.py +0 -33
  457. data/vendor/depot_tools/third_party/boto/file/key.py +0 -199
  458. data/vendor/depot_tools/third_party/boto/file/simpleresultset.py +0 -30
  459. data/vendor/depot_tools/third_party/boto/fps/__init__.py +0 -21
  460. data/vendor/depot_tools/third_party/boto/fps/connection.py +0 -369
  461. data/vendor/depot_tools/third_party/boto/fps/exception.py +0 -344
  462. data/vendor/depot_tools/third_party/boto/fps/response.py +0 -175
  463. data/vendor/depot_tools/third_party/boto/gs/__init__.py +0 -22
  464. data/vendor/depot_tools/third_party/boto/gs/acl.py +0 -304
  465. data/vendor/depot_tools/third_party/boto/gs/bucket.py +0 -870
  466. data/vendor/depot_tools/third_party/boto/gs/bucketlistresultset.py +0 -64
  467. data/vendor/depot_tools/third_party/boto/gs/connection.py +0 -103
  468. data/vendor/depot_tools/third_party/boto/gs/cors.py +0 -169
  469. data/vendor/depot_tools/third_party/boto/gs/key.py +0 -704
  470. data/vendor/depot_tools/third_party/boto/gs/resumable_upload_handler.py +0 -659
  471. data/vendor/depot_tools/third_party/boto/gs/user.py +0 -54
  472. data/vendor/depot_tools/third_party/boto/handler.py +0 -44
  473. data/vendor/depot_tools/third_party/boto/https_connection.py +0 -124
  474. data/vendor/depot_tools/third_party/boto/jsonresponse.py +0 -163
  475. data/vendor/depot_tools/third_party/boto/manage/__init__.py +0 -23
  476. data/vendor/depot_tools/third_party/boto/manage/cmdshell.py +0 -241
  477. data/vendor/depot_tools/third_party/boto/manage/propget.py +0 -64
  478. data/vendor/depot_tools/third_party/boto/manage/server.py +0 -556
  479. data/vendor/depot_tools/third_party/boto/manage/task.py +0 -175
  480. data/vendor/depot_tools/third_party/boto/manage/test_manage.py +0 -34
  481. data/vendor/depot_tools/third_party/boto/manage/volume.py +0 -420
  482. data/vendor/depot_tools/third_party/boto/mashups/__init__.py +0 -23
  483. data/vendor/depot_tools/third_party/boto/mashups/interactive.py +0 -97
  484. data/vendor/depot_tools/third_party/boto/mashups/iobject.py +0 -115
  485. data/vendor/depot_tools/third_party/boto/mashups/order.py +0 -211
  486. data/vendor/depot_tools/third_party/boto/mashups/server.py +0 -395
  487. data/vendor/depot_tools/third_party/boto/plugin.py +0 -90
  488. data/vendor/depot_tools/third_party/boto/provider.py +0 -337
  489. data/vendor/depot_tools/third_party/boto/pyami/__init__.py +0 -22
  490. data/vendor/depot_tools/third_party/boto/pyami/bootstrap.py +0 -134
  491. data/vendor/depot_tools/third_party/boto/pyami/config.py +0 -229
  492. data/vendor/depot_tools/third_party/boto/pyami/copybot.cfg +0 -60
  493. data/vendor/depot_tools/third_party/boto/pyami/copybot.py +0 -97
  494. data/vendor/depot_tools/third_party/boto/pyami/helloworld.py +0 -28
  495. data/vendor/depot_tools/third_party/boto/pyami/launch_ami.py +0 -178
  496. data/vendor/depot_tools/third_party/boto/pyami/scriptbase.py +0 -44
  497. data/vendor/depot_tools/third_party/boto/pyami/startup.py +0 -60
  498. data/vendor/depot_tools/third_party/boto/regioninfo.py +0 -63
  499. data/vendor/depot_tools/third_party/boto/resultset.py +0 -169
  500. data/vendor/depot_tools/third_party/boto/roboto/__init__.py +0 -1
  501. data/vendor/depot_tools/third_party/boto/roboto/awsqueryrequest.py +0 -504
  502. data/vendor/depot_tools/third_party/boto/roboto/awsqueryservice.py +0 -121
  503. data/vendor/depot_tools/third_party/boto/roboto/param.py +0 -147
  504. data/vendor/depot_tools/third_party/boto/s3/__init__.py +0 -84
  505. data/vendor/depot_tools/third_party/boto/s3/acl.py +0 -164
  506. data/vendor/depot_tools/third_party/boto/s3/bucket.py +0 -1634
  507. data/vendor/depot_tools/third_party/boto/s3/bucketlistresultset.py +0 -139
  508. data/vendor/depot_tools/third_party/boto/s3/bucketlogging.py +0 -83
  509. data/vendor/depot_tools/third_party/boto/s3/connection.py +0 -540
  510. data/vendor/depot_tools/third_party/boto/s3/cors.py +0 -210
  511. data/vendor/depot_tools/third_party/boto/s3/deletemarker.py +0 -55
  512. data/vendor/depot_tools/third_party/boto/s3/key.py +0 -1712
  513. data/vendor/depot_tools/third_party/boto/s3/keyfile.py +0 -134
  514. data/vendor/depot_tools/third_party/boto/s3/lifecycle.py +0 -231
  515. data/vendor/depot_tools/third_party/boto/s3/multidelete.py +0 -138
  516. data/vendor/depot_tools/third_party/boto/s3/multipart.py +0 -315
  517. data/vendor/depot_tools/third_party/boto/s3/prefix.py +0 -42
  518. data/vendor/depot_tools/third_party/boto/s3/resumable_download_handler.py +0 -339
  519. data/vendor/depot_tools/third_party/boto/s3/tagging.py +0 -71
  520. data/vendor/depot_tools/third_party/boto/s3/user.py +0 -49
  521. data/vendor/depot_tools/third_party/boto/s3/website.py +0 -237
  522. data/vendor/depot_tools/third_party/boto/services/__init__.py +0 -23
  523. data/vendor/depot_tools/third_party/boto/services/bs.py +0 -179
  524. data/vendor/depot_tools/third_party/boto/services/message.py +0 -58
  525. data/vendor/depot_tools/third_party/boto/services/result.py +0 -136
  526. data/vendor/depot_tools/third_party/boto/services/service.py +0 -161
  527. data/vendor/depot_tools/third_party/boto/services/servicedef.py +0 -91
  528. data/vendor/depot_tools/third_party/boto/services/sonofmmm.cfg +0 -43
  529. data/vendor/depot_tools/third_party/boto/services/sonofmmm.py +0 -81
  530. data/vendor/depot_tools/third_party/boto/services/submit.py +0 -88
  531. data/vendor/depot_tools/third_party/boto/ses/__init__.py +0 -54
  532. data/vendor/depot_tools/third_party/boto/ses/connection.py +0 -521
  533. data/vendor/depot_tools/third_party/boto/ses/exceptions.py +0 -77
  534. data/vendor/depot_tools/third_party/boto/storage_uri.py +0 -835
  535. data/vendor/depot_tools/third_party/boto/sts/__init__.py +0 -55
  536. data/vendor/depot_tools/third_party/boto/sts/connection.py +0 -207
  537. data/vendor/depot_tools/third_party/boto/sts/credentials.py +0 -215
  538. data/vendor/depot_tools/third_party/boto/utils.py +0 -927
  539. data/vendor/depot_tools/third_party/colorama/README.txt +0 -304
  540. data/vendor/depot_tools/third_party/fancy_urllib/README +0 -22
  541. data/vendor/depot_tools/third_party/fancy_urllib/__init__.py +0 -460
  542. data/vendor/depot_tools/third_party/logilab/README.chromium +0 -6
  543. data/vendor/depot_tools/third_party/logilab/__init__.py +0 -0
  544. data/vendor/depot_tools/third_party/logilab/astroid/LICENSE.txt +0 -340
  545. data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +0 -11
  546. data/vendor/depot_tools/third_party/logilab/astroid/__init__.py +0 -136
  547. data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +0 -42
  548. data/vendor/depot_tools/third_party/logilab/astroid/arguments.py +0 -233
  549. data/vendor/depot_tools/third_party/logilab/astroid/as_string.py +0 -548
  550. data/vendor/depot_tools/third_party/logilab/astroid/astpeephole.py +0 -86
  551. data/vendor/depot_tools/third_party/logilab/astroid/bases.py +0 -636
  552. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_builtin_inference.py +0 -336
  553. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_dateutil.py +0 -15
  554. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_gi.py +0 -195
  555. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_mechanize.py +0 -18
  556. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_nose.py +0 -82
  557. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_numpy.py +0 -62
  558. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_pytest.py +0 -76
  559. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_qt.py +0 -44
  560. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_six.py +0 -288
  561. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_ssl.py +0 -65
  562. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_stdlib.py +0 -473
  563. data/vendor/depot_tools/third_party/logilab/astroid/builder.py +0 -263
  564. data/vendor/depot_tools/third_party/logilab/astroid/context.py +0 -81
  565. data/vendor/depot_tools/third_party/logilab/astroid/decorators.py +0 -75
  566. data/vendor/depot_tools/third_party/logilab/astroid/exceptions.py +0 -71
  567. data/vendor/depot_tools/third_party/logilab/astroid/inference.py +0 -359
  568. data/vendor/depot_tools/third_party/logilab/astroid/manager.py +0 -267
  569. data/vendor/depot_tools/third_party/logilab/astroid/mixins.py +0 -147
  570. data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +0 -741
  571. data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +0 -1053
  572. data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +0 -87
  573. data/vendor/depot_tools/third_party/logilab/astroid/objects.py +0 -186
  574. data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +0 -470
  575. data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +0 -390
  576. data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +0 -989
  577. data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +0 -1716
  578. data/vendor/depot_tools/third_party/logilab/astroid/test_utils.py +0 -201
  579. data/vendor/depot_tools/third_party/logilab/astroid/transforms.py +0 -96
  580. data/vendor/depot_tools/third_party/logilab/astroid/util.py +0 -89
  581. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/LICENSE +0 -19
  582. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/README.chromium +0 -11
  583. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/__init__.py +0 -20
  584. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/cext.c +0 -1421
  585. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/compat.py +0 -9
  586. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/simple.py +0 -246
  587. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/slots.py +0 -414
  588. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/utils.py +0 -13
  589. data/vendor/depot_tools/third_party/logilab/wrapt/LICENSE +0 -24
  590. data/vendor/depot_tools/third_party/logilab/wrapt/README.chromium +0 -11
  591. data/vendor/depot_tools/third_party/logilab/wrapt/__init__.py +0 -19
  592. data/vendor/depot_tools/third_party/logilab/wrapt/_wrappers.c +0 -2729
  593. data/vendor/depot_tools/third_party/logilab/wrapt/arguments.py +0 -96
  594. data/vendor/depot_tools/third_party/logilab/wrapt/decorators.py +0 -512
  595. data/vendor/depot_tools/third_party/logilab/wrapt/importer.py +0 -228
  596. data/vendor/depot_tools/third_party/logilab/wrapt/wrappers.py +0 -901
  597. data/vendor/depot_tools/third_party/mock/LICENSE.txt +0 -26
  598. data/vendor/depot_tools/third_party/mock/README.chromium +0 -24
  599. data/vendor/depot_tools/third_party/mock/__init__.py +0 -2366
  600. data/vendor/depot_tools/third_party/oauth2client/LICENSE +0 -202
  601. data/vendor/depot_tools/third_party/oauth2client/MODIFICATIONS.diff +0 -66
  602. data/vendor/depot_tools/third_party/oauth2client/README.chromium +0 -15
  603. data/vendor/depot_tools/third_party/oauth2client/__init__.py +0 -5
  604. data/vendor/depot_tools/third_party/oauth2client/anyjson.py +0 -32
  605. data/vendor/depot_tools/third_party/oauth2client/appengine.py +0 -963
  606. data/vendor/depot_tools/third_party/oauth2client/client.py +0 -1363
  607. data/vendor/depot_tools/third_party/oauth2client/clientsecrets.py +0 -153
  608. data/vendor/depot_tools/third_party/oauth2client/crypt.py +0 -377
  609. data/vendor/depot_tools/third_party/oauth2client/django_orm.py +0 -134
  610. data/vendor/depot_tools/third_party/oauth2client/file.py +0 -124
  611. data/vendor/depot_tools/third_party/oauth2client/gce.py +0 -90
  612. data/vendor/depot_tools/third_party/oauth2client/keyring_storage.py +0 -109
  613. data/vendor/depot_tools/third_party/oauth2client/locked_file.py +0 -373
  614. data/vendor/depot_tools/third_party/oauth2client/multistore_file.py +0 -465
  615. data/vendor/depot_tools/third_party/oauth2client/old_run.py +0 -160
  616. data/vendor/depot_tools/third_party/oauth2client/tools.py +0 -243
  617. data/vendor/depot_tools/third_party/oauth2client/util.py +0 -196
  618. data/vendor/depot_tools/third_party/oauth2client/xsrfutil.py +0 -113
  619. data/vendor/depot_tools/third_party/protobuf26/README.chromium +0 -23
  620. data/vendor/depot_tools/third_party/protobuf26/__init__.py +0 -0
  621. data/vendor/depot_tools/third_party/protobuf26/compiler/__init__.py +0 -0
  622. data/vendor/depot_tools/third_party/protobuf26/compiler/plugin_pb2.py +0 -184
  623. data/vendor/depot_tools/third_party/protobuf26/descriptor.py +0 -849
  624. data/vendor/depot_tools/third_party/protobuf26/descriptor_database.py +0 -137
  625. data/vendor/depot_tools/third_party/protobuf26/descriptor_pb2.py +0 -1522
  626. data/vendor/depot_tools/third_party/protobuf26/descriptor_pool.py +0 -643
  627. data/vendor/depot_tools/third_party/protobuf26/internal/__init__.py +0 -0
  628. data/vendor/depot_tools/third_party/protobuf26/internal/api_implementation.py +0 -89
  629. data/vendor/depot_tools/third_party/protobuf26/internal/containers.py +0 -269
  630. data/vendor/depot_tools/third_party/protobuf26/internal/cpp_message.py +0 -663
  631. data/vendor/depot_tools/third_party/protobuf26/internal/decoder.py +0 -831
  632. data/vendor/depot_tools/third_party/protobuf26/internal/encoder.py +0 -788
  633. data/vendor/depot_tools/third_party/protobuf26/internal/enum_type_wrapper.py +0 -89
  634. data/vendor/depot_tools/third_party/protobuf26/internal/message_listener.py +0 -78
  635. data/vendor/depot_tools/third_party/protobuf26/internal/python_message.py +0 -1247
  636. data/vendor/depot_tools/third_party/protobuf26/internal/type_checkers.py +0 -328
  637. data/vendor/depot_tools/third_party/protobuf26/internal/wire_format.py +0 -268
  638. data/vendor/depot_tools/third_party/protobuf26/message.py +0 -284
  639. data/vendor/depot_tools/third_party/protobuf26/message_factory.py +0 -155
  640. data/vendor/depot_tools/third_party/protobuf26/reflection.py +0 -205
  641. data/vendor/depot_tools/third_party/protobuf26/service.py +0 -226
  642. data/vendor/depot_tools/third_party/protobuf26/service_reflection.py +0 -284
  643. data/vendor/depot_tools/third_party/protobuf26/symbol_database.py +0 -185
  644. data/vendor/depot_tools/third_party/protobuf26/text_encoding.py +0 -110
  645. data/vendor/depot_tools/third_party/protobuf26/text_format.py +0 -873
  646. data/vendor/depot_tools/third_party/pylint.py +0 -37
  647. data/vendor/depot_tools/third_party/pylint/LICENSE.txt +0 -340
  648. data/vendor/depot_tools/third_party/pylint/README.chromium +0 -30
  649. data/vendor/depot_tools/third_party/pylint/__init__.py +0 -46
  650. data/vendor/depot_tools/third_party/pylint/__main__.py +0 -3
  651. data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +0 -80
  652. data/vendor/depot_tools/third_party/pylint/checkers/__init__.py +0 -123
  653. data/vendor/depot_tools/third_party/pylint/checkers/async.py +0 -82
  654. data/vendor/depot_tools/third_party/pylint/checkers/base.py +0 -2010
  655. data/vendor/depot_tools/third_party/pylint/checkers/classes.py +0 -1120
  656. data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +0 -348
  657. data/vendor/depot_tools/third_party/pylint/checkers/exceptions.py +0 -369
  658. data/vendor/depot_tools/third_party/pylint/checkers/format.py +0 -993
  659. data/vendor/depot_tools/third_party/pylint/checkers/imports.py +0 -654
  660. data/vendor/depot_tools/third_party/pylint/checkers/logging.py +0 -258
  661. data/vendor/depot_tools/third_party/pylint/checkers/misc.py +0 -105
  662. data/vendor/depot_tools/third_party/pylint/checkers/newstyle.py +0 -169
  663. data/vendor/depot_tools/third_party/pylint/checkers/python3.py +0 -591
  664. data/vendor/depot_tools/third_party/pylint/checkers/raw_metrics.py +0 -129
  665. data/vendor/depot_tools/third_party/pylint/checkers/similar.py +0 -371
  666. data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +0 -264
  667. data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +0 -280
  668. data/vendor/depot_tools/third_party/pylint/checkers/strings.py +0 -618
  669. data/vendor/depot_tools/third_party/pylint/checkers/typecheck.py +0 -974
  670. data/vendor/depot_tools/third_party/pylint/checkers/utils.py +0 -741
  671. data/vendor/depot_tools/third_party/pylint/checkers/variables.py +0 -1191
  672. data/vendor/depot_tools/third_party/pylint/config.py +0 -820
  673. data/vendor/depot_tools/third_party/pylint/epylint.py +0 -181
  674. data/vendor/depot_tools/third_party/pylint/extensions/__init__.py +0 -0
  675. data/vendor/depot_tools/third_party/pylint/extensions/check_docs.py +0 -311
  676. data/vendor/depot_tools/third_party/pylint/extensions/check_elif.py +0 -62
  677. data/vendor/depot_tools/third_party/pylint/graph.py +0 -179
  678. data/vendor/depot_tools/third_party/pylint/gui.py +0 -531
  679. data/vendor/depot_tools/third_party/pylint/interfaces.py +0 -102
  680. data/vendor/depot_tools/third_party/pylint/lint.py +0 -1381
  681. data/vendor/depot_tools/third_party/pylint/pyreverse/__init__.py +0 -5
  682. data/vendor/depot_tools/third_party/pylint/pyreverse/diadefslib.py +0 -230
  683. data/vendor/depot_tools/third_party/pylint/pyreverse/diagrams.py +0 -258
  684. data/vendor/depot_tools/third_party/pylint/pyreverse/inspector.py +0 -372
  685. data/vendor/depot_tools/third_party/pylint/pyreverse/main.py +0 -147
  686. data/vendor/depot_tools/third_party/pylint/pyreverse/utils.py +0 -210
  687. data/vendor/depot_tools/third_party/pylint/pyreverse/vcgutils.py +0 -198
  688. data/vendor/depot_tools/third_party/pylint/pyreverse/writer.py +0 -198
  689. data/vendor/depot_tools/third_party/pylint/reporters/__init__.py +0 -149
  690. data/vendor/depot_tools/third_party/pylint/reporters/guireporter.py +0 -27
  691. data/vendor/depot_tools/third_party/pylint/reporters/html.py +0 -108
  692. data/vendor/depot_tools/third_party/pylint/reporters/json.py +0 -64
  693. data/vendor/depot_tools/third_party/pylint/reporters/text.py +0 -237
  694. data/vendor/depot_tools/third_party/pylint/reporters/ureports/__init__.py +0 -106
  695. data/vendor/depot_tools/third_party/pylint/reporters/ureports/html_writer.py +0 -93
  696. data/vendor/depot_tools/third_party/pylint/reporters/ureports/nodes.py +0 -181
  697. data/vendor/depot_tools/third_party/pylint/reporters/ureports/text_writer.py +0 -99
  698. data/vendor/depot_tools/third_party/pylint/testutils.py +0 -414
  699. data/vendor/depot_tools/third_party/pylint/utils.py +0 -1148
  700. data/vendor/depot_tools/third_party/pymox/COPYING +0 -202
  701. data/vendor/depot_tools/third_party/pymox/MANIFEST.in +0 -5
  702. data/vendor/depot_tools/third_party/pymox/README +0 -56
  703. data/vendor/depot_tools/third_party/pymox/__init__.py +0 -0
  704. data/vendor/depot_tools/third_party/pymox/mox.py +0 -1643
  705. data/vendor/depot_tools/third_party/pymox/mox_test.py +0 -1708
  706. data/vendor/depot_tools/third_party/pymox/mox_test_helper.py +0 -76
  707. data/vendor/depot_tools/third_party/pymox/setup.py +0 -14
  708. data/vendor/depot_tools/third_party/pymox/stubout.py +0 -142
  709. data/vendor/depot_tools/third_party/pymox/stubout_test.py +0 -47
  710. data/vendor/depot_tools/third_party/pymox/stubout_testee.py +0 -2
  711. data/vendor/depot_tools/third_party/simplejson/LICENSE.txt +0 -19
  712. data/vendor/depot_tools/third_party/simplejson/PKG-INFO +0 -29
  713. data/vendor/depot_tools/third_party/simplejson/__init__.py +0 -437
  714. data/vendor/depot_tools/third_party/simplejson/decoder.py +0 -421
  715. data/vendor/depot_tools/third_party/simplejson/encoder.py +0 -501
  716. data/vendor/depot_tools/third_party/simplejson/ordered_dict.py +0 -119
  717. data/vendor/depot_tools/third_party/simplejson/scanner.py +0 -77
  718. data/vendor/depot_tools/third_party/simplejson/tool.py +0 -39
  719. data/vendor/depot_tools/third_party/upload.py +0 -2565
@@ -1,13 +0,0 @@
1
- def identity(obj):
2
- return obj
3
-
4
-
5
- class cached_property(object):
6
- def __init__(self, func):
7
- self.func = func
8
-
9
- def __get__(self, obj, cls):
10
- if obj is None:
11
- return self
12
- value = obj.__dict__[self.func.__name__] = self.func(obj)
13
- return value
@@ -1,24 +0,0 @@
1
- Copyright (c) 2013-2017, Graham Dumpleton
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
-
14
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
- POSSIBILITY OF SUCH DAMAGE.
@@ -1,11 +0,0 @@
1
- URL: https://github.com/GrahamDumpleton/wrapt
2
- URL: https://pypi.org/project/wrapt/#files
3
- Version: 1.10.11
4
- License: BSD-2
5
- License File: LICENSE
6
-
7
- Description:
8
- This directory contains the wrapt module, required for pylint.
9
-
10
- Local Modifications:
11
- None
@@ -1,19 +0,0 @@
1
- __version_info__ = ('1', '10', '11')
2
- __version__ = '.'.join(__version_info__)
3
-
4
- from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
5
- BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
6
- wrap_object, wrap_object_attribute, function_wrapper,
7
- wrap_function_wrapper, patch_function_wrapper,
8
- transient_function_wrapper)
9
-
10
- from .decorators import (adapter_factory, AdapterFactory, decorator,
11
- synchronized)
12
-
13
- from .importer import (register_post_import_hook, when_imported,
14
- notify_module_loaded, discover_post_import_hooks)
15
-
16
- try:
17
- from inspect import getcallargs
18
- except ImportError:
19
- from .arguments import getcallargs
@@ -1,2729 +0,0 @@
1
- /* ------------------------------------------------------------------------- */
2
-
3
- #include "Python.h"
4
-
5
- #include "structmember.h"
6
-
7
- #ifndef PyVarObject_HEAD_INIT
8
- #define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
9
- #endif
10
-
11
- /* ------------------------------------------------------------------------- */
12
-
13
- typedef struct {
14
- PyObject_HEAD
15
-
16
- PyObject *dict;
17
- PyObject *wrapped;
18
- PyObject *weakreflist;
19
- } WraptObjectProxyObject;
20
-
21
- PyTypeObject WraptObjectProxy_Type;
22
- PyTypeObject WraptCallableObjectProxy_Type;
23
-
24
- typedef struct {
25
- WraptObjectProxyObject object_proxy;
26
-
27
- PyObject *instance;
28
- PyObject *wrapper;
29
- PyObject *enabled;
30
- PyObject *binding;
31
- PyObject *parent;
32
- } WraptFunctionWrapperObject;
33
-
34
- PyTypeObject WraptFunctionWrapperBase_Type;
35
- PyTypeObject WraptBoundFunctionWrapper_Type;
36
- PyTypeObject WraptFunctionWrapper_Type;
37
-
38
- /* ------------------------------------------------------------------------- */
39
-
40
- static PyObject *WraptObjectProxy_new(PyTypeObject *type,
41
- PyObject *args, PyObject *kwds)
42
- {
43
- WraptObjectProxyObject *self;
44
-
45
- self = (WraptObjectProxyObject *)type->tp_alloc(type, 0);
46
-
47
- if (!self)
48
- return NULL;
49
-
50
- self->dict = PyDict_New();
51
- self->wrapped = NULL;
52
- self->weakreflist = NULL;
53
-
54
- return (PyObject *)self;
55
- }
56
-
57
- /* ------------------------------------------------------------------------- */
58
-
59
- static int WraptObjectProxy_raw_init(WraptObjectProxyObject *self,
60
- PyObject *wrapped)
61
- {
62
- static PyObject *module_str = NULL;
63
- static PyObject *doc_str = NULL;
64
-
65
- PyObject *object = NULL;
66
-
67
- Py_INCREF(wrapped);
68
- Py_XDECREF(self->wrapped);
69
- self->wrapped = wrapped;
70
-
71
- if (!module_str) {
72
- #if PY_MAJOR_VERSION >= 3
73
- module_str = PyUnicode_InternFromString("__module__");
74
- #else
75
- module_str = PyString_InternFromString("__module__");
76
- #endif
77
- }
78
-
79
- if (!doc_str) {
80
- #if PY_MAJOR_VERSION >= 3
81
- doc_str = PyUnicode_InternFromString("__doc__");
82
- #else
83
- doc_str = PyString_InternFromString("__doc__");
84
- #endif
85
- }
86
-
87
- object = PyObject_GetAttr(wrapped, module_str);
88
-
89
- if (object) {
90
- if (PyDict_SetItem(self->dict, module_str, object) == -1) {
91
- Py_DECREF(object);
92
- return -1;
93
- }
94
- Py_DECREF(object);
95
- }
96
- else
97
- PyErr_Clear();
98
-
99
- object = PyObject_GetAttr(wrapped, doc_str);
100
-
101
- if (object) {
102
- if (PyDict_SetItem(self->dict, doc_str, object) == -1) {
103
- Py_DECREF(object);
104
- return -1;
105
- }
106
- Py_DECREF(object);
107
- }
108
- else
109
- PyErr_Clear();
110
-
111
- return 0;
112
- }
113
-
114
- /* ------------------------------------------------------------------------- */
115
-
116
- static int WraptObjectProxy_init(WraptObjectProxyObject *self,
117
- PyObject *args, PyObject *kwds)
118
- {
119
- PyObject *wrapped = NULL;
120
-
121
- static char *kwlist[] = { "wrapped", NULL };
122
-
123
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:ObjectProxy",
124
- kwlist, &wrapped)) {
125
- return -1;
126
- }
127
-
128
- return WraptObjectProxy_raw_init(self, wrapped);
129
- }
130
-
131
- /* ------------------------------------------------------------------------- */
132
-
133
- static int WraptObjectProxy_traverse(WraptObjectProxyObject *self,
134
- visitproc visit, void *arg)
135
- {
136
- Py_VISIT(self->dict);
137
- Py_VISIT(self->wrapped);
138
-
139
- return 0;
140
- }
141
-
142
- /* ------------------------------------------------------------------------- */
143
-
144
- static int WraptObjectProxy_clear(WraptObjectProxyObject *self)
145
- {
146
- Py_CLEAR(self->dict);
147
- Py_CLEAR(self->wrapped);
148
-
149
- return 0;
150
- }
151
-
152
- /* ------------------------------------------------------------------------- */
153
-
154
- static void WraptObjectProxy_dealloc(WraptObjectProxyObject *self)
155
- {
156
- PyObject_GC_UnTrack(self);
157
-
158
- if (self->weakreflist != NULL)
159
- PyObject_ClearWeakRefs((PyObject *)self);
160
-
161
- WraptObjectProxy_clear(self);
162
-
163
- Py_TYPE(self)->tp_free(self);
164
- }
165
-
166
- /* ------------------------------------------------------------------------- */
167
-
168
- static PyObject *WraptObjectProxy_repr(WraptObjectProxyObject *self)
169
- {
170
- if (!self->wrapped) {
171
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
172
- return NULL;
173
- }
174
-
175
- #if PY_MAJOR_VERSION >= 3
176
- return PyUnicode_FromFormat("<%s at %p for %s at %p>",
177
- Py_TYPE(self)->tp_name, self,
178
- Py_TYPE(self->wrapped)->tp_name, self->wrapped);
179
- #else
180
- return PyString_FromFormat("<%s at %p for %s at %p>",
181
- Py_TYPE(self)->tp_name, self,
182
- Py_TYPE(self->wrapped)->tp_name, self->wrapped);
183
- #endif
184
- }
185
-
186
- /* ------------------------------------------------------------------------- */
187
-
188
- static long WraptObjectProxy_hash(WraptObjectProxyObject *self)
189
- {
190
- if (!self->wrapped) {
191
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
192
- return -1;
193
- }
194
-
195
- return PyObject_Hash(self->wrapped);
196
- }
197
-
198
- /* ------------------------------------------------------------------------- */
199
-
200
- static PyObject *WraptObjectProxy_str(WraptObjectProxyObject *self)
201
- {
202
- if (!self->wrapped) {
203
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
204
- return NULL;
205
- }
206
-
207
- return PyObject_Str(self->wrapped);
208
- }
209
-
210
- /* ------------------------------------------------------------------------- */
211
-
212
- static PyObject *WraptObjectProxy_add(PyObject *o1, PyObject *o2)
213
- {
214
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
215
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
216
- return NULL;
217
- }
218
-
219
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
220
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
221
- return NULL;
222
- }
223
-
224
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
225
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
226
-
227
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
228
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
229
-
230
- return PyNumber_Add(o1, o2);
231
- }
232
-
233
- /* ------------------------------------------------------------------------- */
234
-
235
- static PyObject *WraptObjectProxy_subtract(PyObject *o1, PyObject *o2)
236
- {
237
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
238
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
239
- return NULL;
240
- }
241
-
242
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
243
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
244
- return NULL;
245
- }
246
-
247
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
248
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
249
-
250
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
251
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
252
-
253
-
254
- return PyNumber_Subtract(o1, o2);
255
- }
256
-
257
- /* ------------------------------------------------------------------------- */
258
-
259
- static PyObject *WraptObjectProxy_multiply(PyObject *o1, PyObject *o2)
260
- {
261
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
262
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
263
- return NULL;
264
- }
265
-
266
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
267
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
268
- return NULL;
269
- }
270
-
271
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
272
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
273
-
274
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
275
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
276
-
277
- return PyNumber_Multiply(o1, o2);
278
- }
279
-
280
- /* ------------------------------------------------------------------------- */
281
-
282
- #if PY_MAJOR_VERSION < 3
283
- static PyObject *WraptObjectProxy_divide(PyObject *o1, PyObject *o2)
284
- {
285
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
286
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
287
- return NULL;
288
- }
289
-
290
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
291
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
292
- return NULL;
293
- }
294
-
295
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
296
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
297
-
298
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
299
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
300
-
301
- return PyNumber_Divide(o1, o2);
302
- }
303
- #endif
304
-
305
- /* ------------------------------------------------------------------------- */
306
-
307
- static PyObject *WraptObjectProxy_remainder(PyObject *o1, PyObject *o2)
308
- {
309
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
310
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
311
- return NULL;
312
- }
313
-
314
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
315
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
316
- return NULL;
317
- }
318
-
319
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
320
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
321
-
322
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
323
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
324
-
325
- return PyNumber_Remainder(o1, o2);
326
- }
327
-
328
- /* ------------------------------------------------------------------------- */
329
-
330
- static PyObject *WraptObjectProxy_divmod(PyObject *o1, PyObject *o2)
331
- {
332
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
333
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
334
- return NULL;
335
- }
336
-
337
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
338
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
339
- return NULL;
340
- }
341
-
342
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
343
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
344
-
345
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
346
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
347
-
348
- return PyNumber_Divmod(o1, o2);
349
- }
350
-
351
- /* ------------------------------------------------------------------------- */
352
-
353
- static PyObject *WraptObjectProxy_power(PyObject *o1, PyObject *o2,
354
- PyObject *modulo)
355
- {
356
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
357
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
358
- return NULL;
359
- }
360
-
361
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
362
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
363
- return NULL;
364
- }
365
-
366
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
367
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
368
-
369
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
370
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
371
-
372
- return PyNumber_Power(o1, o2, modulo);
373
- }
374
-
375
- /* ------------------------------------------------------------------------- */
376
-
377
- static PyObject *WraptObjectProxy_negative(WraptObjectProxyObject *self)
378
- {
379
- if (!self->wrapped) {
380
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
381
- return NULL;
382
- }
383
-
384
- return PyNumber_Negative(self->wrapped);
385
- }
386
-
387
- /* ------------------------------------------------------------------------- */
388
-
389
- static PyObject *WraptObjectProxy_positive(WraptObjectProxyObject *self)
390
- {
391
- if (!self->wrapped) {
392
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
393
- return NULL;
394
- }
395
-
396
- return PyNumber_Positive(self->wrapped);
397
- }
398
-
399
- /* ------------------------------------------------------------------------- */
400
-
401
- static PyObject *WraptObjectProxy_absolute(WraptObjectProxyObject *self)
402
- {
403
- if (!self->wrapped) {
404
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
405
- return NULL;
406
- }
407
-
408
- return PyNumber_Absolute(self->wrapped);
409
- }
410
-
411
- /* ------------------------------------------------------------------------- */
412
-
413
- static int WraptObjectProxy_bool(WraptObjectProxyObject *self)
414
- {
415
- if (!self->wrapped) {
416
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
417
- return -1;
418
- }
419
-
420
- return PyObject_IsTrue(self->wrapped);
421
- }
422
-
423
- /* ------------------------------------------------------------------------- */
424
-
425
- static PyObject *WraptObjectProxy_invert(WraptObjectProxyObject *self)
426
- {
427
- if (!self->wrapped) {
428
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
429
- return NULL;
430
- }
431
-
432
- return PyNumber_Invert(self->wrapped);
433
- }
434
-
435
- /* ------------------------------------------------------------------------- */
436
-
437
- static PyObject *WraptObjectProxy_lshift(PyObject *o1, PyObject *o2)
438
- {
439
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
440
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
441
- return NULL;
442
- }
443
-
444
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
445
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
446
- return NULL;
447
- }
448
-
449
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
450
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
451
-
452
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
453
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
454
-
455
- return PyNumber_Lshift(o1, o2);
456
- }
457
-
458
- /* ------------------------------------------------------------------------- */
459
-
460
- static PyObject *WraptObjectProxy_rshift(PyObject *o1, PyObject *o2)
461
- {
462
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
463
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
464
- return NULL;
465
- }
466
-
467
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
468
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
469
- return NULL;
470
- }
471
-
472
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
473
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
474
-
475
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
476
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
477
-
478
- return PyNumber_Rshift(o1, o2);
479
- }
480
-
481
- /* ------------------------------------------------------------------------- */
482
-
483
- static PyObject *WraptObjectProxy_and(PyObject *o1, PyObject *o2)
484
- {
485
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
486
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
487
- return NULL;
488
- }
489
-
490
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
491
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
492
- return NULL;
493
- }
494
-
495
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
496
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
497
-
498
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
499
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
500
-
501
- return PyNumber_And(o1, o2);
502
- }
503
-
504
- /* ------------------------------------------------------------------------- */
505
-
506
- static PyObject *WraptObjectProxy_xor(PyObject *o1, PyObject *o2)
507
- {
508
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
509
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
510
- return NULL;
511
- }
512
-
513
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
514
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
515
- return NULL;
516
- }
517
-
518
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
519
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
520
-
521
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
522
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
523
-
524
- return PyNumber_Xor(o1, o2);
525
- }
526
-
527
- /* ------------------------------------------------------------------------- */
528
-
529
- static PyObject *WraptObjectProxy_or(PyObject *o1, PyObject *o2)
530
- {
531
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
532
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
533
- return NULL;
534
- }
535
-
536
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
537
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
538
- return NULL;
539
- }
540
-
541
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
542
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
543
-
544
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
545
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
546
-
547
- return PyNumber_Or(o1, o2);
548
- }
549
-
550
- /* ------------------------------------------------------------------------- */
551
-
552
- #if PY_MAJOR_VERSION < 3
553
- static PyObject *WraptObjectProxy_int(WraptObjectProxyObject *self)
554
- {
555
- if (!self->wrapped) {
556
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
557
- return NULL;
558
- }
559
-
560
- return PyNumber_Int(self->wrapped);
561
- }
562
- #endif
563
-
564
- /* ------------------------------------------------------------------------- */
565
-
566
- static PyObject *WraptObjectProxy_long(WraptObjectProxyObject *self)
567
- {
568
- if (!self->wrapped) {
569
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
570
- return NULL;
571
- }
572
-
573
- return PyNumber_Long(self->wrapped);
574
- }
575
-
576
- /* ------------------------------------------------------------------------- */
577
-
578
- static PyObject *WraptObjectProxy_float(WraptObjectProxyObject *self)
579
- {
580
- if (!self->wrapped) {
581
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
582
- return NULL;
583
- }
584
-
585
- return PyNumber_Float(self->wrapped);
586
- }
587
-
588
- /* ------------------------------------------------------------------------- */
589
-
590
- #if PY_MAJOR_VERSION < 3
591
- static PyObject *WraptObjectProxy_oct(WraptObjectProxyObject *self)
592
- {
593
- PyNumberMethods *nb;
594
-
595
- if (!self->wrapped) {
596
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
597
- return NULL;
598
- }
599
-
600
- if ((nb = self->wrapped->ob_type->tp_as_number) == NULL ||
601
- nb->nb_oct == NULL) {
602
- PyErr_SetString(PyExc_TypeError,
603
- "oct() argument can't be converted to oct");
604
- return NULL;
605
- }
606
-
607
- return (*nb->nb_oct)(self->wrapped);
608
- }
609
- #endif
610
-
611
- /* ------------------------------------------------------------------------- */
612
-
613
- #if PY_MAJOR_VERSION < 3
614
- static PyObject *WraptObjectProxy_hex(WraptObjectProxyObject *self)
615
- {
616
- PyNumberMethods *nb;
617
-
618
- if (!self->wrapped) {
619
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
620
- return NULL;
621
- }
622
-
623
- if ((nb = self->wrapped->ob_type->tp_as_number) == NULL ||
624
- nb->nb_hex == NULL) {
625
- PyErr_SetString(PyExc_TypeError,
626
- "hex() argument can't be converted to hex");
627
- return NULL;
628
- }
629
-
630
- return (*nb->nb_hex)(self->wrapped);
631
- }
632
- #endif
633
-
634
- /* ------------------------------------------------------------------------- */
635
-
636
- static PyObject *WraptObjectProxy_inplace_add(WraptObjectProxyObject *self,
637
- PyObject *other)
638
- {
639
- PyObject *object = NULL;
640
-
641
- if (!self->wrapped) {
642
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
643
- return NULL;
644
- }
645
-
646
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
647
- other = ((WraptObjectProxyObject *)other)->wrapped;
648
-
649
- object = PyNumber_InPlaceAdd(self->wrapped, other);
650
-
651
- if (!object)
652
- return NULL;
653
-
654
- Py_DECREF(self->wrapped);
655
- self->wrapped = object;
656
-
657
- Py_INCREF(self);
658
- return (PyObject *)self;
659
- }
660
-
661
- /* ------------------------------------------------------------------------- */
662
-
663
- static PyObject *WraptObjectProxy_inplace_subtract(
664
- WraptObjectProxyObject *self, PyObject *other)
665
- {
666
- PyObject *object = NULL;
667
-
668
- if (!self->wrapped) {
669
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
670
- return NULL;
671
- }
672
-
673
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
674
- other = ((WraptObjectProxyObject *)other)->wrapped;
675
-
676
- object = PyNumber_InPlaceSubtract(self->wrapped, other);
677
-
678
- if (!object)
679
- return NULL;
680
-
681
- Py_DECREF(self->wrapped);
682
- self->wrapped = object;
683
-
684
- Py_INCREF(self);
685
- return (PyObject *)self;
686
- }
687
-
688
- /* ------------------------------------------------------------------------- */
689
-
690
- static PyObject *WraptObjectProxy_inplace_multiply(
691
- WraptObjectProxyObject *self, PyObject *other)
692
- {
693
- PyObject *object = NULL;
694
-
695
- if (!self->wrapped) {
696
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
697
- return NULL;
698
- }
699
-
700
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
701
- other = ((WraptObjectProxyObject *)other)->wrapped;
702
-
703
- object = PyNumber_InPlaceMultiply(self->wrapped, other);
704
-
705
- if (!object)
706
- return NULL;
707
-
708
- Py_DECREF(self->wrapped);
709
- self->wrapped = object;
710
-
711
- Py_INCREF(self);
712
- return (PyObject *)self;
713
- }
714
-
715
- /* ------------------------------------------------------------------------- */
716
-
717
- #if PY_MAJOR_VERSION < 3
718
- static PyObject *WraptObjectProxy_inplace_divide(
719
- WraptObjectProxyObject *self, PyObject *other)
720
- {
721
- PyObject *object = NULL;
722
-
723
- if (!self->wrapped) {
724
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
725
- return NULL;
726
- }
727
-
728
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
729
- other = ((WraptObjectProxyObject *)other)->wrapped;
730
-
731
- object = PyNumber_InPlaceDivide(self->wrapped, other);
732
-
733
- if (!object)
734
- return NULL;
735
-
736
- Py_DECREF(self->wrapped);
737
- self->wrapped = object;
738
-
739
- Py_INCREF(self);
740
- return (PyObject *)self;
741
- }
742
- #endif
743
-
744
- /* ------------------------------------------------------------------------- */
745
-
746
- static PyObject *WraptObjectProxy_inplace_remainder(
747
- WraptObjectProxyObject *self, PyObject *other)
748
- {
749
- PyObject *object = NULL;
750
-
751
- if (!self->wrapped) {
752
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
753
- return NULL;
754
- }
755
-
756
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
757
- other = ((WraptObjectProxyObject *)other)->wrapped;
758
-
759
- object = PyNumber_InPlaceRemainder(self->wrapped, other);
760
-
761
- if (!object)
762
- return NULL;
763
-
764
- Py_DECREF(self->wrapped);
765
- self->wrapped = object;
766
-
767
- Py_INCREF(self);
768
- return (PyObject *)self;
769
- }
770
-
771
- /* ------------------------------------------------------------------------- */
772
-
773
- static PyObject *WraptObjectProxy_inplace_power(WraptObjectProxyObject *self,
774
- PyObject *other, PyObject *modulo)
775
- {
776
- PyObject *object = NULL;
777
-
778
- if (!self->wrapped) {
779
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
780
- return NULL;
781
- }
782
-
783
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
784
- other = ((WraptObjectProxyObject *)other)->wrapped;
785
-
786
- object = PyNumber_InPlacePower(self->wrapped, other, modulo);
787
-
788
- if (!object)
789
- return NULL;
790
-
791
- Py_DECREF(self->wrapped);
792
- self->wrapped = object;
793
-
794
- Py_INCREF(self);
795
- return (PyObject *)self;
796
- }
797
-
798
- /* ------------------------------------------------------------------------- */
799
-
800
- static PyObject *WraptObjectProxy_inplace_lshift(WraptObjectProxyObject *self,
801
- PyObject *other)
802
- {
803
- PyObject *object = NULL;
804
-
805
- if (!self->wrapped) {
806
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
807
- return NULL;
808
- }
809
-
810
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
811
- other = ((WraptObjectProxyObject *)other)->wrapped;
812
-
813
- object = PyNumber_InPlaceLshift(self->wrapped, other);
814
-
815
- if (!object)
816
- return NULL;
817
-
818
- Py_DECREF(self->wrapped);
819
- self->wrapped = object;
820
-
821
- Py_INCREF(self);
822
- return (PyObject *)self;
823
- }
824
-
825
- /* ------------------------------------------------------------------------- */
826
-
827
- static PyObject *WraptObjectProxy_inplace_rshift(WraptObjectProxyObject *self,
828
- PyObject *other)
829
- {
830
- PyObject *object = NULL;
831
-
832
- if (!self->wrapped) {
833
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
834
- return NULL;
835
- }
836
-
837
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
838
- other = ((WraptObjectProxyObject *)other)->wrapped;
839
-
840
- object = PyNumber_InPlaceRshift(self->wrapped, other);
841
-
842
- if (!object)
843
- return NULL;
844
-
845
- Py_DECREF(self->wrapped);
846
- self->wrapped = object;
847
-
848
- Py_INCREF(self);
849
- return (PyObject *)self;
850
- }
851
-
852
- /* ------------------------------------------------------------------------- */
853
-
854
- static PyObject *WraptObjectProxy_inplace_and(WraptObjectProxyObject *self,
855
- PyObject *other)
856
- {
857
- PyObject *object = NULL;
858
-
859
- if (!self->wrapped) {
860
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
861
- return NULL;
862
- }
863
-
864
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
865
- other = ((WraptObjectProxyObject *)other)->wrapped;
866
-
867
- object = PyNumber_InPlaceAnd(self->wrapped, other);
868
-
869
- if (!object)
870
- return NULL;
871
-
872
- Py_DECREF(self->wrapped);
873
- self->wrapped = object;
874
-
875
- Py_INCREF(self);
876
- return (PyObject *)self;
877
- }
878
-
879
- /* ------------------------------------------------------------------------- */
880
-
881
- static PyObject *WraptObjectProxy_inplace_xor(WraptObjectProxyObject *self,
882
- PyObject *other)
883
- {
884
- PyObject *object = NULL;
885
-
886
- if (!self->wrapped) {
887
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
888
- return NULL;
889
- }
890
-
891
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
892
- other = ((WraptObjectProxyObject *)other)->wrapped;
893
-
894
- object = PyNumber_InPlaceXor(self->wrapped, other);
895
-
896
- if (!object)
897
- return NULL;
898
-
899
- Py_DECREF(self->wrapped);
900
- self->wrapped = object;
901
-
902
- Py_INCREF(self);
903
- return (PyObject *)self;
904
- }
905
-
906
- /* ------------------------------------------------------------------------- */
907
-
908
- static PyObject *WraptObjectProxy_inplace_or(WraptObjectProxyObject *self,
909
- PyObject *other)
910
- {
911
- PyObject *object = NULL;
912
-
913
- if (!self->wrapped) {
914
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
915
- return NULL;
916
- }
917
-
918
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
919
- other = ((WraptObjectProxyObject *)other)->wrapped;
920
-
921
- object = PyNumber_InPlaceOr(self->wrapped, other);
922
-
923
- Py_DECREF(self->wrapped);
924
- self->wrapped = object;
925
-
926
- Py_INCREF(self);
927
- return (PyObject *)self;
928
- }
929
-
930
- /* ------------------------------------------------------------------------- */
931
-
932
- static PyObject *WraptObjectProxy_floor_divide(PyObject *o1, PyObject *o2)
933
- {
934
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
935
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
936
- return NULL;
937
- }
938
-
939
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
940
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
941
- return NULL;
942
- }
943
-
944
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
945
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
946
-
947
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
948
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
949
-
950
- return PyNumber_FloorDivide(o1, o2);
951
- }
952
-
953
- /* ------------------------------------------------------------------------- */
954
-
955
- static PyObject *WraptObjectProxy_true_divide(PyObject *o1, PyObject *o2)
956
- {
957
- if (!((WraptObjectProxyObject *)o1)->wrapped) {
958
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
959
- return NULL;
960
- }
961
-
962
- if (!((WraptObjectProxyObject *)o2)->wrapped) {
963
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
964
- return NULL;
965
- }
966
-
967
- if (PyObject_IsInstance(o1, (PyObject *)&WraptObjectProxy_Type))
968
- o1 = ((WraptObjectProxyObject *)o1)->wrapped;
969
-
970
- if (PyObject_IsInstance(o2, (PyObject *)&WraptObjectProxy_Type))
971
- o2 = ((WraptObjectProxyObject *)o2)->wrapped;
972
-
973
- return PyNumber_TrueDivide(o1, o2);
974
- }
975
-
976
- /* ------------------------------------------------------------------------- */
977
-
978
- static PyObject *WraptObjectProxy_inplace_floor_divide(
979
- WraptObjectProxyObject *self, PyObject *other)
980
- {
981
- PyObject *object = NULL;
982
-
983
- if (!self->wrapped) {
984
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
985
- return NULL;
986
- }
987
-
988
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
989
- other = ((WraptObjectProxyObject *)other)->wrapped;
990
-
991
- object = PyNumber_InPlaceFloorDivide(self->wrapped, other);
992
-
993
- if (!object)
994
- return NULL;
995
-
996
- Py_DECREF(self->wrapped);
997
- self->wrapped = object;
998
-
999
- Py_INCREF(self);
1000
- return (PyObject *)self;
1001
- }
1002
-
1003
- /* ------------------------------------------------------------------------- */
1004
-
1005
- static PyObject *WraptObjectProxy_inplace_true_divide(
1006
- WraptObjectProxyObject *self, PyObject *other)
1007
- {
1008
- PyObject *object = NULL;
1009
-
1010
- if (!self->wrapped) {
1011
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1012
- return NULL;
1013
- }
1014
-
1015
- if (PyObject_IsInstance(other, (PyObject *)&WraptObjectProxy_Type))
1016
- other = ((WraptObjectProxyObject *)other)->wrapped;
1017
-
1018
- object = PyNumber_InPlaceTrueDivide(self->wrapped, other);
1019
-
1020
- if (!object)
1021
- return NULL;
1022
-
1023
- Py_DECREF(self->wrapped);
1024
- self->wrapped = object;
1025
-
1026
- Py_INCREF(self);
1027
- return (PyObject *)self;
1028
- }
1029
-
1030
- /* ------------------------------------------------------------------------- */
1031
-
1032
- static PyObject *WraptObjectProxy_index(WraptObjectProxyObject *self)
1033
- {
1034
- if (!self->wrapped) {
1035
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1036
- return NULL;
1037
- }
1038
-
1039
- return PyNumber_Index(self->wrapped);
1040
- }
1041
-
1042
- /* ------------------------------------------------------------------------- */
1043
-
1044
- static Py_ssize_t WraptObjectProxy_length(WraptObjectProxyObject *self)
1045
- {
1046
- if (!self->wrapped) {
1047
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1048
- return -1;
1049
- }
1050
-
1051
- return PyObject_Length(self->wrapped);
1052
- }
1053
-
1054
- /* ------------------------------------------------------------------------- */
1055
-
1056
- static int WraptObjectProxy_contains(WraptObjectProxyObject *self,
1057
- PyObject *value)
1058
- {
1059
- if (!self->wrapped) {
1060
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1061
- return -1;
1062
- }
1063
-
1064
- return PySequence_Contains(self->wrapped, value);
1065
- }
1066
-
1067
- /* ------------------------------------------------------------------------- */
1068
-
1069
- static PyObject *WraptObjectProxy_getitem(WraptObjectProxyObject *self,
1070
- PyObject *key)
1071
- {
1072
- if (!self->wrapped) {
1073
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1074
- return NULL;
1075
- }
1076
-
1077
- return PyObject_GetItem(self->wrapped, key);
1078
- }
1079
-
1080
- /* ------------------------------------------------------------------------- */
1081
-
1082
- static int WraptObjectProxy_setitem(WraptObjectProxyObject *self,
1083
- PyObject *key, PyObject* value)
1084
- {
1085
- if (!self->wrapped) {
1086
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1087
- return -1;
1088
- }
1089
-
1090
- if (value == NULL)
1091
- return PyObject_DelItem(self->wrapped, key);
1092
- else
1093
- return PyObject_SetItem(self->wrapped, key, value);
1094
- }
1095
-
1096
- /* ------------------------------------------------------------------------- */
1097
-
1098
- static PyObject *WraptObjectProxy_dir(
1099
- WraptObjectProxyObject *self, PyObject *args)
1100
- {
1101
- if (!self->wrapped) {
1102
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1103
- return NULL;
1104
- }
1105
-
1106
- return PyObject_Dir(self->wrapped);
1107
- }
1108
-
1109
- /* ------------------------------------------------------------------------- */
1110
-
1111
- static PyObject *WraptObjectProxy_enter(
1112
- WraptObjectProxyObject *self, PyObject *args, PyObject *kwds)
1113
- {
1114
- PyObject *method = NULL;
1115
- PyObject *result = NULL;
1116
-
1117
- if (!self->wrapped) {
1118
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1119
- return NULL;
1120
- }
1121
-
1122
- method = PyObject_GetAttrString(self->wrapped, "__enter__");
1123
-
1124
- if (!method)
1125
- return NULL;
1126
-
1127
- result = PyObject_Call(method, args, kwds);
1128
-
1129
- Py_DECREF(method);
1130
-
1131
- return result;
1132
- }
1133
-
1134
- /* ------------------------------------------------------------------------- */
1135
-
1136
- static PyObject *WraptObjectProxy_exit(
1137
- WraptObjectProxyObject *self, PyObject *args, PyObject *kwds)
1138
- {
1139
- PyObject *method = NULL;
1140
- PyObject *result = NULL;
1141
-
1142
- if (!self->wrapped) {
1143
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1144
- return NULL;
1145
- }
1146
-
1147
- method = PyObject_GetAttrString(self->wrapped, "__exit__");
1148
-
1149
- if (!method)
1150
- return NULL;
1151
-
1152
- result = PyObject_Call(method, args, kwds);
1153
-
1154
- Py_DECREF(method);
1155
-
1156
- return result;
1157
- }
1158
-
1159
- /* ------------------------------------------------------------------------- */
1160
-
1161
- static PyObject *WraptObjectProxy_bytes(
1162
- WraptObjectProxyObject *self, PyObject *args)
1163
- {
1164
- if (!self->wrapped) {
1165
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1166
- return NULL;
1167
- }
1168
-
1169
- return PyObject_Bytes(self->wrapped);
1170
- }
1171
-
1172
- /* ------------------------------------------------------------------------- */
1173
-
1174
- static PyObject *WraptObjectProxy_reversed(
1175
- WraptObjectProxyObject *self, PyObject *args)
1176
- {
1177
- if (!self->wrapped) {
1178
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1179
- return NULL;
1180
- }
1181
-
1182
- return PyObject_CallFunctionObjArgs((PyObject *)&PyReversed_Type,
1183
- self->wrapped, NULL);
1184
- }
1185
-
1186
- /* ------------------------------------------------------------------------- */
1187
-
1188
- #if PY_MAJOR_VERSION >= 3
1189
- static PyObject *WraptObjectProxy_round(
1190
- WraptObjectProxyObject *self, PyObject *args)
1191
- {
1192
- PyObject *module = NULL;
1193
- PyObject *dict = NULL;
1194
- PyObject *round = NULL;
1195
-
1196
- PyObject *result = NULL;
1197
-
1198
- if (!self->wrapped) {
1199
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1200
- return NULL;
1201
- }
1202
-
1203
- module = PyImport_ImportModule("builtins");
1204
-
1205
- if (!module)
1206
- return NULL;
1207
-
1208
- dict = PyModule_GetDict(module);
1209
- round = PyDict_GetItemString(dict, "round");
1210
-
1211
- if (!round) {
1212
- Py_DECREF(module);
1213
- return NULL;
1214
- }
1215
-
1216
- Py_INCREF(round);
1217
- Py_DECREF(module);
1218
-
1219
- result = PyObject_CallFunctionObjArgs(round, self->wrapped, NULL);
1220
-
1221
- Py_DECREF(round);
1222
-
1223
- return result;
1224
- }
1225
- #endif
1226
-
1227
- /* ------------------------------------------------------------------------- */
1228
-
1229
- static PyObject *WraptObjectProxy_get_name(
1230
- WraptObjectProxyObject *self)
1231
- {
1232
- if (!self->wrapped) {
1233
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1234
- return NULL;
1235
- }
1236
-
1237
- return PyObject_GetAttrString(self->wrapped, "__name__");
1238
- }
1239
-
1240
- /* ------------------------------------------------------------------------- */
1241
-
1242
- static int WraptObjectProxy_set_name(WraptObjectProxyObject *self,
1243
- PyObject *value)
1244
- {
1245
- if (!self->wrapped) {
1246
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1247
- return -1;
1248
- }
1249
-
1250
- return PyObject_SetAttrString(self->wrapped, "__name__", value);
1251
- }
1252
-
1253
- /* ------------------------------------------------------------------------- */
1254
-
1255
- static PyObject *WraptObjectProxy_get_qualname(
1256
- WraptObjectProxyObject *self)
1257
- {
1258
- if (!self->wrapped) {
1259
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1260
- return NULL;
1261
- }
1262
-
1263
- return PyObject_GetAttrString(self->wrapped, "__qualname__");
1264
- }
1265
-
1266
- /* ------------------------------------------------------------------------- */
1267
-
1268
- static int WraptObjectProxy_set_qualname(WraptObjectProxyObject *self,
1269
- PyObject *value)
1270
- {
1271
- if (!self->wrapped) {
1272
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1273
- return -1;
1274
- }
1275
-
1276
- return PyObject_SetAttrString(self->wrapped, "__qualname__", value);
1277
- }
1278
-
1279
- /* ------------------------------------------------------------------------- */
1280
-
1281
- static PyObject *WraptObjectProxy_get_module(
1282
- WraptObjectProxyObject *self)
1283
- {
1284
- if (!self->wrapped) {
1285
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1286
- return NULL;
1287
- }
1288
-
1289
- return PyObject_GetAttrString(self->wrapped, "__module__");
1290
- }
1291
-
1292
- /* ------------------------------------------------------------------------- */
1293
-
1294
- static int WraptObjectProxy_set_module(WraptObjectProxyObject *self,
1295
- PyObject *value)
1296
- {
1297
- if (!self->wrapped) {
1298
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1299
- return -1;
1300
- }
1301
-
1302
- if (PyObject_SetAttrString(self->wrapped, "__module__", value) == -1)
1303
- return -1;
1304
-
1305
- return PyDict_SetItemString(self->dict, "__module__", value);
1306
- }
1307
-
1308
- /* ------------------------------------------------------------------------- */
1309
-
1310
- static PyObject *WraptObjectProxy_get_doc(
1311
- WraptObjectProxyObject *self)
1312
- {
1313
- if (!self->wrapped) {
1314
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1315
- return NULL;
1316
- }
1317
-
1318
- return PyObject_GetAttrString(self->wrapped, "__doc__");
1319
- }
1320
-
1321
- /* ------------------------------------------------------------------------- */
1322
-
1323
- static int WraptObjectProxy_set_doc(WraptObjectProxyObject *self,
1324
- PyObject *value)
1325
- {
1326
- if (!self->wrapped) {
1327
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1328
- return -1;
1329
- }
1330
-
1331
- if (PyObject_SetAttrString(self->wrapped, "__doc__", value) == -1)
1332
- return -1;
1333
-
1334
- return PyDict_SetItemString(self->dict, "__doc__", value);
1335
- }
1336
-
1337
- /* ------------------------------------------------------------------------- */
1338
-
1339
- static PyObject *WraptObjectProxy_get_class(
1340
- WraptObjectProxyObject *self)
1341
- {
1342
- if (!self->wrapped) {
1343
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1344
- return NULL;
1345
- }
1346
-
1347
- return PyObject_GetAttrString(self->wrapped, "__class__");
1348
- }
1349
-
1350
- /* ------------------------------------------------------------------------- */
1351
-
1352
- static PyObject *WraptObjectProxy_get_annotations(
1353
- WraptObjectProxyObject *self)
1354
- {
1355
- if (!self->wrapped) {
1356
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1357
- return NULL;
1358
- }
1359
-
1360
- return PyObject_GetAttrString(self->wrapped, "__annotations__");
1361
- }
1362
-
1363
- /* ------------------------------------------------------------------------- */
1364
-
1365
- static int WraptObjectProxy_set_annotations(WraptObjectProxyObject *self,
1366
- PyObject *value)
1367
- {
1368
- if (!self->wrapped) {
1369
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1370
- return -1;
1371
- }
1372
-
1373
- return PyObject_SetAttrString(self->wrapped, "__annotations__", value);
1374
- }
1375
-
1376
- /* ------------------------------------------------------------------------- */
1377
-
1378
- static PyObject *WraptObjectProxy_get_wrapped(
1379
- WraptObjectProxyObject *self)
1380
- {
1381
- if (!self->wrapped) {
1382
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1383
- return NULL;
1384
- }
1385
-
1386
- Py_INCREF(self->wrapped);
1387
- return self->wrapped;
1388
- }
1389
-
1390
- /* ------------------------------------------------------------------------- */
1391
-
1392
- static int WraptObjectProxy_set_wrapped(WraptObjectProxyObject *self,
1393
- PyObject *value)
1394
- {
1395
- if (!value) {
1396
- PyErr_SetString(PyExc_TypeError, "__wrapped__ must be an object");
1397
- return -1;
1398
- }
1399
-
1400
- Py_INCREF(value);
1401
- Py_XDECREF(self->wrapped);
1402
-
1403
- self->wrapped = value;
1404
-
1405
- return 0;
1406
- }
1407
-
1408
- /* ------------------------------------------------------------------------- */
1409
-
1410
- static PyObject *WraptObjectProxy_getattro(
1411
- WraptObjectProxyObject *self, PyObject *name)
1412
- {
1413
- PyObject *object = NULL;
1414
- PyObject *result = NULL;
1415
-
1416
- static PyObject *getattr_str = NULL;
1417
-
1418
- object = PyObject_GenericGetAttr((PyObject *)self, name);
1419
-
1420
- if (object)
1421
- return object;
1422
-
1423
- PyErr_Clear();
1424
-
1425
- if (!getattr_str) {
1426
- #if PY_MAJOR_VERSION >= 3
1427
- getattr_str = PyUnicode_InternFromString("__getattr__");
1428
- #else
1429
- getattr_str = PyString_InternFromString("__getattr__");
1430
- #endif
1431
- }
1432
-
1433
- object = PyObject_GenericGetAttr((PyObject *)self, getattr_str);
1434
-
1435
- if (!object)
1436
- return NULL;
1437
-
1438
- result = PyObject_CallFunctionObjArgs(object, name, NULL);
1439
-
1440
- Py_DECREF(object);
1441
-
1442
- return result;
1443
- }
1444
-
1445
- /* ------------------------------------------------------------------------- */
1446
-
1447
- static PyObject *WraptObjectProxy_getattr(
1448
- WraptObjectProxyObject *self, PyObject *args)
1449
- {
1450
- PyObject *name = NULL;
1451
-
1452
- #if PY_MAJOR_VERSION >= 3
1453
- if (!PyArg_ParseTuple(args, "U:__getattr__", &name))
1454
- return NULL;
1455
- #else
1456
- if (!PyArg_ParseTuple(args, "S:__getattr__", &name))
1457
- return NULL;
1458
- #endif
1459
-
1460
- if (!self->wrapped) {
1461
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1462
- return NULL;
1463
- }
1464
-
1465
- return PyObject_GetAttr(self->wrapped, name);
1466
- }
1467
-
1468
- /* ------------------------------------------------------------------------- */
1469
-
1470
- static int WraptObjectProxy_setattro(
1471
- WraptObjectProxyObject *self, PyObject *name, PyObject *value)
1472
- {
1473
- static PyObject *self_str = NULL;
1474
- static PyObject *wrapped_str = NULL;
1475
- static PyObject *startswith_str = NULL;
1476
-
1477
- PyObject *match = NULL;
1478
-
1479
- if (!startswith_str) {
1480
- #if PY_MAJOR_VERSION >= 3
1481
- startswith_str = PyUnicode_InternFromString("startswith");
1482
- #else
1483
- startswith_str = PyString_InternFromString("startswith");
1484
- #endif
1485
- }
1486
-
1487
- if (!self_str) {
1488
- #if PY_MAJOR_VERSION >= 3
1489
- self_str = PyUnicode_InternFromString("_self_");
1490
- #else
1491
- self_str = PyString_InternFromString("_self_");
1492
- #endif
1493
- }
1494
-
1495
- match = PyObject_CallMethodObjArgs(name, startswith_str, self_str, NULL);
1496
-
1497
- if (match == Py_True) {
1498
- Py_DECREF(match);
1499
-
1500
- return PyObject_GenericSetAttr((PyObject *)self, name, value);
1501
- }
1502
- else if (!match)
1503
- PyErr_Clear();
1504
-
1505
- Py_XDECREF(match);
1506
-
1507
- if (!wrapped_str) {
1508
- #if PY_MAJOR_VERSION >= 3
1509
- wrapped_str = PyUnicode_InternFromString("__wrapped__");
1510
- #else
1511
- wrapped_str = PyString_InternFromString("__wrapped__");
1512
- #endif
1513
- }
1514
-
1515
- if (PyObject_HasAttr((PyObject *)Py_TYPE(self), name))
1516
- return PyObject_GenericSetAttr((PyObject *)self, name, value);
1517
-
1518
- if (!self->wrapped) {
1519
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1520
- return -1;
1521
- }
1522
-
1523
- return PyObject_SetAttr(self->wrapped, name, value);
1524
- }
1525
-
1526
- /* ------------------------------------------------------------------------- */
1527
-
1528
- static PyObject *WraptObjectProxy_richcompare(WraptObjectProxyObject *self,
1529
- PyObject *other, int opcode)
1530
- {
1531
- if (!self->wrapped) {
1532
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1533
- return NULL;
1534
- }
1535
-
1536
- return PyObject_RichCompare(self->wrapped, other, opcode);
1537
- }
1538
-
1539
- /* ------------------------------------------------------------------------- */
1540
-
1541
- static PyObject *WraptObjectProxy_iter(WraptObjectProxyObject *self)
1542
- {
1543
- if (!self->wrapped) {
1544
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1545
- return NULL;
1546
- }
1547
-
1548
- return PyObject_GetIter(self->wrapped);
1549
- }
1550
-
1551
- /* ------------------------------------------------------------------------- */
1552
-
1553
- static PyNumberMethods WraptObjectProxy_as_number = {
1554
- (binaryfunc)WraptObjectProxy_add, /*nb_add*/
1555
- (binaryfunc)WraptObjectProxy_subtract, /*nb_subtract*/
1556
- (binaryfunc)WraptObjectProxy_multiply, /*nb_multiply*/
1557
- #if PY_MAJOR_VERSION < 3
1558
- (binaryfunc)WraptObjectProxy_divide, /*nb_divide*/
1559
- #endif
1560
- (binaryfunc)WraptObjectProxy_remainder, /*nb_remainder*/
1561
- (binaryfunc)WraptObjectProxy_divmod, /*nb_divmod*/
1562
- (ternaryfunc)WraptObjectProxy_power, /*nb_power*/
1563
- (unaryfunc)WraptObjectProxy_negative, /*nb_negative*/
1564
- (unaryfunc)WraptObjectProxy_positive, /*nb_positive*/
1565
- (unaryfunc)WraptObjectProxy_absolute, /*nb_absolute*/
1566
- (inquiry)WraptObjectProxy_bool, /*nb_nonzero/nb_bool*/
1567
- (unaryfunc)WraptObjectProxy_invert, /*nb_invert*/
1568
- (binaryfunc)WraptObjectProxy_lshift, /*nb_lshift*/
1569
- (binaryfunc)WraptObjectProxy_rshift, /*nb_rshift*/
1570
- (binaryfunc)WraptObjectProxy_and, /*nb_and*/
1571
- (binaryfunc)WraptObjectProxy_xor, /*nb_xor*/
1572
- (binaryfunc)WraptObjectProxy_or, /*nb_or*/
1573
- #if PY_MAJOR_VERSION < 3
1574
- 0, /*nb_coerce*/
1575
- #endif
1576
- #if PY_MAJOR_VERSION < 3
1577
- (unaryfunc)WraptObjectProxy_int, /*nb_int*/
1578
- (unaryfunc)WraptObjectProxy_long, /*nb_long*/
1579
- #else
1580
- (unaryfunc)WraptObjectProxy_long, /*nb_int*/
1581
- 0, /*nb_long/nb_reserved*/
1582
- #endif
1583
- (unaryfunc)WraptObjectProxy_float, /*nb_float*/
1584
- #if PY_MAJOR_VERSION < 3
1585
- (unaryfunc)WraptObjectProxy_oct, /*nb_oct*/
1586
- (unaryfunc)WraptObjectProxy_hex, /*nb_hex*/
1587
- #endif
1588
- (binaryfunc)WraptObjectProxy_inplace_add, /*nb_inplace_add*/
1589
- (binaryfunc)WraptObjectProxy_inplace_subtract, /*nb_inplace_subtract*/
1590
- (binaryfunc)WraptObjectProxy_inplace_multiply, /*nb_inplace_multiply*/
1591
- #if PY_MAJOR_VERSION < 3
1592
- (binaryfunc)WraptObjectProxy_inplace_divide, /*nb_inplace_divide*/
1593
- #endif
1594
- (binaryfunc)WraptObjectProxy_inplace_remainder, /*nb_inplace_remainder*/
1595
- (ternaryfunc)WraptObjectProxy_inplace_power, /*nb_inplace_power*/
1596
- (binaryfunc)WraptObjectProxy_inplace_lshift, /*nb_inplace_lshift*/
1597
- (binaryfunc)WraptObjectProxy_inplace_rshift, /*nb_inplace_rshift*/
1598
- (binaryfunc)WraptObjectProxy_inplace_and, /*nb_inplace_and*/
1599
- (binaryfunc)WraptObjectProxy_inplace_xor, /*nb_inplace_xor*/
1600
- (binaryfunc)WraptObjectProxy_inplace_or, /*nb_inplace_or*/
1601
- (binaryfunc)WraptObjectProxy_floor_divide, /*nb_floor_divide*/
1602
- (binaryfunc)WraptObjectProxy_true_divide, /*nb_true_divide*/
1603
- (binaryfunc)WraptObjectProxy_inplace_floor_divide, /*nb_inplace_floor_divide*/
1604
- (binaryfunc)WraptObjectProxy_inplace_true_divide, /*nb_inplace_true_divide*/
1605
- (unaryfunc)WraptObjectProxy_index, /*nb_index*/
1606
- };
1607
-
1608
- static PySequenceMethods WraptObjectProxy_as_sequence = {
1609
- (lenfunc)WraptObjectProxy_length, /*sq_length*/
1610
- 0, /*sq_concat*/
1611
- 0, /*sq_repeat*/
1612
- 0, /*sq_item*/
1613
- 0, /*sq_slice*/
1614
- 0, /*sq_ass_item*/
1615
- 0, /*sq_ass_slice*/
1616
- (objobjproc)WraptObjectProxy_contains, /* sq_contains */
1617
- };
1618
-
1619
- static PyMappingMethods WraptObjectProxy_as_mapping = {
1620
- (lenfunc)WraptObjectProxy_length, /*mp_length*/
1621
- (binaryfunc)WraptObjectProxy_getitem, /*mp_subscript*/
1622
- (objobjargproc)WraptObjectProxy_setitem, /*mp_ass_subscript*/
1623
- };
1624
-
1625
- static PyMethodDef WraptObjectProxy_methods[] = {
1626
- { "__dir__", (PyCFunction)WraptObjectProxy_dir, METH_NOARGS, 0 },
1627
- { "__enter__", (PyCFunction)WraptObjectProxy_enter,
1628
- METH_VARARGS | METH_KEYWORDS, 0 },
1629
- { "__exit__", (PyCFunction)WraptObjectProxy_exit,
1630
- METH_VARARGS | METH_KEYWORDS, 0 },
1631
- { "__getattr__", (PyCFunction)WraptObjectProxy_getattr,
1632
- METH_VARARGS , 0 },
1633
- { "__bytes__", (PyCFunction)WraptObjectProxy_bytes, METH_NOARGS, 0 },
1634
- { "__reversed__", (PyCFunction)WraptObjectProxy_reversed, METH_NOARGS, 0 },
1635
- #if PY_MAJOR_VERSION >= 3
1636
- { "__round__", (PyCFunction)WraptObjectProxy_round, METH_NOARGS, 0 },
1637
- #endif
1638
- { NULL, NULL },
1639
- };
1640
-
1641
- static PyGetSetDef WraptObjectProxy_getset[] = {
1642
- { "__name__", (getter)WraptObjectProxy_get_name,
1643
- (setter)WraptObjectProxy_set_name, 0 },
1644
- { "__qualname__", (getter)WraptObjectProxy_get_qualname,
1645
- (setter)WraptObjectProxy_set_qualname, 0 },
1646
- { "__module__", (getter)WraptObjectProxy_get_module,
1647
- (setter)WraptObjectProxy_set_module, 0 },
1648
- { "__doc__", (getter)WraptObjectProxy_get_doc,
1649
- (setter)WraptObjectProxy_set_doc, 0 },
1650
- { "__class__", (getter)WraptObjectProxy_get_class,
1651
- NULL, 0 },
1652
- { "__annotations__", (getter)WraptObjectProxy_get_annotations,
1653
- (setter)WraptObjectProxy_set_annotations, 0 },
1654
- { "__wrapped__", (getter)WraptObjectProxy_get_wrapped,
1655
- (setter)WraptObjectProxy_set_wrapped, 0 },
1656
- { NULL },
1657
- };
1658
-
1659
- PyTypeObject WraptObjectProxy_Type = {
1660
- PyVarObject_HEAD_INIT(NULL, 0)
1661
- "ObjectProxy", /*tp_name*/
1662
- sizeof(WraptObjectProxyObject), /*tp_basicsize*/
1663
- 0, /*tp_itemsize*/
1664
- /* methods */
1665
- (destructor)WraptObjectProxy_dealloc, /*tp_dealloc*/
1666
- 0, /*tp_print*/
1667
- 0, /*tp_getattr*/
1668
- 0, /*tp_setattr*/
1669
- 0, /*tp_compare*/
1670
- (unaryfunc)WraptObjectProxy_repr, /*tp_repr*/
1671
- &WraptObjectProxy_as_number, /*tp_as_number*/
1672
- &WraptObjectProxy_as_sequence, /*tp_as_sequence*/
1673
- &WraptObjectProxy_as_mapping, /*tp_as_mapping*/
1674
- (hashfunc)WraptObjectProxy_hash, /*tp_hash*/
1675
- 0, /*tp_call*/
1676
- (unaryfunc)WraptObjectProxy_str, /*tp_str*/
1677
- (getattrofunc)WraptObjectProxy_getattro, /*tp_getattro*/
1678
- (setattrofunc)WraptObjectProxy_setattro, /*tp_setattro*/
1679
- 0, /*tp_as_buffer*/
1680
- #if PY_MAJOR_VERSION < 3
1681
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
1682
- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/
1683
- #else
1684
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
1685
- Py_TPFLAGS_HAVE_GC, /*tp_flags*/
1686
- #endif
1687
- 0, /*tp_doc*/
1688
- (traverseproc)WraptObjectProxy_traverse, /*tp_traverse*/
1689
- (inquiry)WraptObjectProxy_clear, /*tp_clear*/
1690
- (richcmpfunc)WraptObjectProxy_richcompare, /*tp_richcompare*/
1691
- offsetof(WraptObjectProxyObject, weakreflist), /*tp_weaklistoffset*/
1692
- (getiterfunc)WraptObjectProxy_iter, /*tp_iter*/
1693
- 0, /*tp_iternext*/
1694
- WraptObjectProxy_methods, /*tp_methods*/
1695
- 0, /*tp_members*/
1696
- WraptObjectProxy_getset, /*tp_getset*/
1697
- 0, /*tp_base*/
1698
- 0, /*tp_dict*/
1699
- 0, /*tp_descr_get*/
1700
- 0, /*tp_descr_set*/
1701
- offsetof(WraptObjectProxyObject, dict), /*tp_dictoffset*/
1702
- (initproc)WraptObjectProxy_init, /*tp_init*/
1703
- PyType_GenericAlloc, /*tp_alloc*/
1704
- WraptObjectProxy_new, /*tp_new*/
1705
- PyObject_GC_Del, /*tp_free*/
1706
- 0, /*tp_is_gc*/
1707
- };
1708
-
1709
- /* ------------------------------------------------------------------------- */
1710
-
1711
- static PyObject *WraptCallableObjectProxy_call(
1712
- WraptObjectProxyObject *self, PyObject *args, PyObject *kwds)
1713
- {
1714
- if (!self->wrapped) {
1715
- PyErr_SetString(PyExc_ValueError, "wrapper has not been initialized");
1716
- return NULL;
1717
- }
1718
-
1719
- return PyObject_Call(self->wrapped, args, kwds);
1720
- }
1721
-
1722
- /* ------------------------------------------------------------------------- */;
1723
-
1724
- static PyGetSetDef WraptCallableObjectProxy_getset[] = {
1725
- { "__module__", (getter)WraptObjectProxy_get_module,
1726
- (setter)WraptObjectProxy_set_module, 0 },
1727
- { "__doc__", (getter)WraptObjectProxy_get_doc,
1728
- (setter)WraptObjectProxy_set_doc, 0 },
1729
- { NULL },
1730
- };
1731
-
1732
- PyTypeObject WraptCallableObjectProxy_Type = {
1733
- PyVarObject_HEAD_INIT(NULL, 0)
1734
- "CallableObjectProxy", /*tp_name*/
1735
- sizeof(WraptObjectProxyObject), /*tp_basicsize*/
1736
- 0, /*tp_itemsize*/
1737
- /* methods */
1738
- 0, /*tp_dealloc*/
1739
- 0, /*tp_print*/
1740
- 0, /*tp_getattr*/
1741
- 0, /*tp_setattr*/
1742
- 0, /*tp_compare*/
1743
- 0, /*tp_repr*/
1744
- 0, /*tp_as_number*/
1745
- 0, /*tp_as_sequence*/
1746
- 0, /*tp_as_mapping*/
1747
- 0, /*tp_hash*/
1748
- (ternaryfunc)WraptCallableObjectProxy_call, /*tp_call*/
1749
- 0, /*tp_str*/
1750
- 0, /*tp_getattro*/
1751
- 0, /*tp_setattro*/
1752
- 0, /*tp_as_buffer*/
1753
- #if PY_MAJOR_VERSION < 3
1754
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/
1755
- #else
1756
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
1757
- #endif
1758
- 0, /*tp_doc*/
1759
- 0, /*tp_traverse*/
1760
- 0, /*tp_clear*/
1761
- 0, /*tp_richcompare*/
1762
- offsetof(WraptObjectProxyObject, weakreflist), /*tp_weaklistoffset*/
1763
- 0, /*tp_iter*/
1764
- 0, /*tp_iternext*/
1765
- 0, /*tp_methods*/
1766
- 0, /*tp_members*/
1767
- WraptCallableObjectProxy_getset, /*tp_getset*/
1768
- 0, /*tp_base*/
1769
- 0, /*tp_dict*/
1770
- 0, /*tp_descr_get*/
1771
- 0, /*tp_descr_set*/
1772
- 0, /*tp_dictoffset*/
1773
- (initproc)WraptObjectProxy_init, /*tp_init*/
1774
- 0, /*tp_alloc*/
1775
- 0, /*tp_new*/
1776
- 0, /*tp_free*/
1777
- 0, /*tp_is_gc*/
1778
- };
1779
-
1780
- /* ------------------------------------------------------------------------- */
1781
-
1782
- static PyObject *WraptFunctionWrapperBase_new(PyTypeObject *type,
1783
- PyObject *args, PyObject *kwds)
1784
- {
1785
- WraptFunctionWrapperObject *self;
1786
-
1787
- self = (WraptFunctionWrapperObject *)WraptObjectProxy_new(type,
1788
- args, kwds);
1789
-
1790
- if (!self)
1791
- return NULL;
1792
-
1793
- self->instance = NULL;
1794
- self->wrapper = NULL;
1795
- self->enabled = NULL;
1796
- self->binding = NULL;
1797
- self->parent = NULL;
1798
-
1799
- return (PyObject *)self;
1800
- }
1801
-
1802
- /* ------------------------------------------------------------------------- */
1803
-
1804
- static int WraptFunctionWrapperBase_raw_init(WraptFunctionWrapperObject *self,
1805
- PyObject *wrapped, PyObject *instance, PyObject *wrapper,
1806
- PyObject *enabled, PyObject *binding, PyObject *parent)
1807
- {
1808
- int result = 0;
1809
-
1810
- result = WraptObjectProxy_raw_init((WraptObjectProxyObject *)self,
1811
- wrapped);
1812
-
1813
- if (result == 0) {
1814
- Py_INCREF(instance);
1815
- Py_XDECREF(self->instance);
1816
- self->instance = instance;
1817
-
1818
- Py_INCREF(wrapper);
1819
- Py_XDECREF(self->wrapper);
1820
- self->wrapper = wrapper;
1821
-
1822
- Py_INCREF(enabled);
1823
- Py_XDECREF(self->enabled);
1824
- self->enabled = enabled;
1825
-
1826
- Py_INCREF(binding);
1827
- Py_XDECREF(self->binding);
1828
- self->binding = binding;
1829
-
1830
- Py_INCREF(parent);
1831
- Py_XDECREF(self->parent);
1832
- self->parent = parent;
1833
- }
1834
-
1835
- return result;
1836
- }
1837
-
1838
- /* ------------------------------------------------------------------------- */
1839
-
1840
- static int WraptFunctionWrapperBase_init(WraptFunctionWrapperObject *self,
1841
- PyObject *args, PyObject *kwds)
1842
- {
1843
- PyObject *wrapped = NULL;
1844
- PyObject *instance = NULL;
1845
- PyObject *wrapper = NULL;
1846
- PyObject *enabled = Py_None;
1847
- PyObject *binding = NULL;
1848
- PyObject *parent = Py_None;
1849
-
1850
- static PyObject *function_str = NULL;
1851
-
1852
- static char *kwlist[] = { "wrapped", "instance", "wrapper",
1853
- "enabled", "binding", "parent", NULL };
1854
-
1855
- if (!function_str) {
1856
- #if PY_MAJOR_VERSION >= 3
1857
- function_str = PyUnicode_InternFromString("function");
1858
- #else
1859
- function_str = PyString_InternFromString("function");
1860
- #endif
1861
- }
1862
-
1863
- if (!PyArg_ParseTupleAndKeywords(args, kwds,
1864
- "OOO|OOO:FunctionWrapperBase", kwlist, &wrapped, &instance,
1865
- &wrapper, &enabled, &binding, &parent)) {
1866
- return -1;
1867
- }
1868
-
1869
- if (!binding)
1870
- binding = function_str;
1871
-
1872
- return WraptFunctionWrapperBase_raw_init(self, wrapped, instance, wrapper,
1873
- enabled, binding, parent);
1874
- }
1875
-
1876
- /* ------------------------------------------------------------------------- */
1877
-
1878
- static int WraptFunctionWrapperBase_traverse(WraptFunctionWrapperObject *self,
1879
- visitproc visit, void *arg)
1880
- {
1881
- WraptObjectProxy_traverse((WraptObjectProxyObject *)self, visit, arg);
1882
-
1883
- Py_VISIT(self->instance);
1884
- Py_VISIT(self->wrapper);
1885
- Py_VISIT(self->enabled);
1886
- Py_VISIT(self->binding);
1887
- Py_VISIT(self->parent);
1888
-
1889
- return 0;
1890
- }
1891
-
1892
- /* ------------------------------------------------------------------------- */
1893
-
1894
- static int WraptFunctionWrapperBase_clear(WraptFunctionWrapperObject *self)
1895
- {
1896
- WraptObjectProxy_clear((WraptObjectProxyObject *)self);
1897
-
1898
- Py_CLEAR(self->instance);
1899
- Py_CLEAR(self->wrapper);
1900
- Py_CLEAR(self->enabled);
1901
- Py_CLEAR(self->binding);
1902
- Py_CLEAR(self->parent);
1903
-
1904
- return 0;
1905
- }
1906
-
1907
- /* ------------------------------------------------------------------------- */
1908
-
1909
- static void WraptFunctionWrapperBase_dealloc(WraptFunctionWrapperObject *self)
1910
- {
1911
- WraptFunctionWrapperBase_clear(self);
1912
-
1913
- WraptObjectProxy_dealloc((WraptObjectProxyObject *)self);
1914
- }
1915
-
1916
- /* ------------------------------------------------------------------------- */
1917
-
1918
- static PyObject *WraptFunctionWrapperBase_call(
1919
- WraptFunctionWrapperObject *self, PyObject *args, PyObject *kwds)
1920
- {
1921
- PyObject *param_kwds = NULL;
1922
-
1923
- PyObject *result = NULL;
1924
-
1925
- static PyObject *function_str = NULL;
1926
-
1927
- if (!function_str) {
1928
- #if PY_MAJOR_VERSION >= 3
1929
- function_str = PyUnicode_InternFromString("function");
1930
- #else
1931
- function_str = PyString_InternFromString("function");
1932
- #endif
1933
- }
1934
-
1935
- if (self->enabled != Py_None) {
1936
- if (PyCallable_Check(self->enabled)) {
1937
- PyObject *object = NULL;
1938
-
1939
- object = PyObject_CallFunctionObjArgs(self->enabled, NULL);
1940
-
1941
- if (!object)
1942
- return NULL;
1943
-
1944
- if (PyObject_Not(object)) {
1945
- Py_DECREF(object);
1946
- return PyObject_Call(self->object_proxy.wrapped, args, kwds);
1947
- }
1948
-
1949
- Py_DECREF(object);
1950
- }
1951
- else if (PyObject_Not(self->enabled)) {
1952
- return PyObject_Call(self->object_proxy.wrapped, args, kwds);
1953
- }
1954
- }
1955
-
1956
- if (!kwds) {
1957
- param_kwds = PyDict_New();
1958
- kwds = param_kwds;
1959
- }
1960
-
1961
- if (self->instance == Py_None && (self->binding == function_str ||
1962
- PyObject_RichCompareBool(self->binding, function_str,
1963
- Py_EQ) == 1)) {
1964
-
1965
- PyObject *instance = NULL;
1966
-
1967
- instance = PyObject_GetAttrString(self->object_proxy.wrapped,
1968
- "__self__");
1969
-
1970
- if (instance) {
1971
- result = PyObject_CallFunctionObjArgs(self->wrapper,
1972
- self->object_proxy.wrapped, instance, args, kwds, NULL);
1973
-
1974
- Py_XDECREF(param_kwds);
1975
-
1976
- Py_DECREF(instance);
1977
-
1978
- return result;
1979
- }
1980
- else
1981
- PyErr_Clear();
1982
- }
1983
-
1984
- result = PyObject_CallFunctionObjArgs(self->wrapper,
1985
- self->object_proxy.wrapped, self->instance, args, kwds, NULL);
1986
-
1987
- Py_XDECREF(param_kwds);
1988
-
1989
- return result;
1990
- }
1991
-
1992
- /* ------------------------------------------------------------------------- */
1993
-
1994
- static PyObject *WraptFunctionWrapperBase_descr_get(
1995
- WraptFunctionWrapperObject *self, PyObject *obj, PyObject *type)
1996
- {
1997
- PyObject *bound_type = NULL;
1998
- PyObject *descriptor = NULL;
1999
- PyObject *result = NULL;
2000
-
2001
- static PyObject *bound_type_str = NULL;
2002
- static PyObject *function_str = NULL;
2003
-
2004
- if (!bound_type_str) {
2005
- #if PY_MAJOR_VERSION >= 3
2006
- bound_type_str = PyUnicode_InternFromString(
2007
- "__bound_function_wrapper__");
2008
- #else
2009
- bound_type_str = PyString_InternFromString(
2010
- "__bound_function_wrapper__");
2011
- #endif
2012
- }
2013
-
2014
- if (!function_str) {
2015
- #if PY_MAJOR_VERSION >= 3
2016
- function_str = PyUnicode_InternFromString("function");
2017
- #else
2018
- function_str = PyString_InternFromString("function");
2019
- #endif
2020
- }
2021
-
2022
- if (self->parent == Py_None) {
2023
- #if PY_MAJOR_VERSION < 3
2024
- if (PyObject_IsInstance(self->object_proxy.wrapped,
2025
- (PyObject *)&PyClass_Type) || PyObject_IsInstance(
2026
- self->object_proxy.wrapped, (PyObject *)&PyType_Type)) {
2027
- Py_INCREF(self);
2028
- return (PyObject *)self;
2029
- }
2030
- #else
2031
- if (PyObject_IsInstance(self->object_proxy.wrapped,
2032
- (PyObject *)&PyType_Type)) {
2033
- Py_INCREF(self);
2034
- return (PyObject *)self;
2035
- }
2036
- #endif
2037
-
2038
- if (Py_TYPE(self->object_proxy.wrapped)->tp_descr_get == NULL) {
2039
- PyErr_Format(PyExc_AttributeError,
2040
- "'%s' object has no attribute '__get__'",
2041
- Py_TYPE(self->object_proxy.wrapped)->tp_name);
2042
- return NULL;
2043
- }
2044
-
2045
- descriptor = (Py_TYPE(self->object_proxy.wrapped)->tp_descr_get)(
2046
- self->object_proxy.wrapped, obj, type);
2047
-
2048
- if (!descriptor)
2049
- return NULL;
2050
-
2051
- if (Py_TYPE(self) != &WraptFunctionWrapper_Type) {
2052
- bound_type = PyObject_GenericGetAttr((PyObject *)self,
2053
- bound_type_str);
2054
-
2055
- if (!bound_type)
2056
- PyErr_Clear();
2057
- }
2058
-
2059
- if (obj == NULL)
2060
- obj = Py_None;
2061
-
2062
- result = PyObject_CallFunctionObjArgs(bound_type ? bound_type :
2063
- (PyObject *)&WraptBoundFunctionWrapper_Type, descriptor,
2064
- obj, self->wrapper, self->enabled, self->binding,
2065
- self, NULL);
2066
-
2067
- Py_XDECREF(bound_type);
2068
- Py_DECREF(descriptor);
2069
-
2070
- return result;
2071
- }
2072
-
2073
- if (self->instance == Py_None && (self->binding == function_str ||
2074
- PyObject_RichCompareBool(self->binding, function_str,
2075
- Py_EQ) == 1)) {
2076
-
2077
- PyObject *wrapped = NULL;
2078
-
2079
- static PyObject *wrapped_str = NULL;
2080
-
2081
- if (!wrapped_str) {
2082
- #if PY_MAJOR_VERSION >= 3
2083
- wrapped_str = PyUnicode_InternFromString("__wrapped__");
2084
- #else
2085
- wrapped_str = PyString_InternFromString("__wrapped__");
2086
- #endif
2087
- }
2088
-
2089
- wrapped = PyObject_GetAttr(self->parent, wrapped_str);
2090
-
2091
- if (!wrapped)
2092
- return NULL;
2093
-
2094
- if (Py_TYPE(wrapped)->tp_descr_get == NULL) {
2095
- PyErr_Format(PyExc_AttributeError,
2096
- "'%s' object has no attribute '__get__'",
2097
- Py_TYPE(wrapped)->tp_name);
2098
- Py_DECREF(wrapped);
2099
- return NULL;
2100
- }
2101
-
2102
- descriptor = (Py_TYPE(wrapped)->tp_descr_get)(wrapped, obj, type);
2103
-
2104
- Py_DECREF(wrapped);
2105
-
2106
- if (!descriptor)
2107
- return NULL;
2108
-
2109
- if (Py_TYPE(self->parent) != &WraptFunctionWrapper_Type) {
2110
- bound_type = PyObject_GenericGetAttr((PyObject *)self->parent,
2111
- bound_type_str);
2112
-
2113
- if (!bound_type)
2114
- PyErr_Clear();
2115
- }
2116
-
2117
- if (obj == NULL)
2118
- obj = Py_None;
2119
-
2120
- result = PyObject_CallFunctionObjArgs(bound_type ? bound_type :
2121
- (PyObject *)&WraptBoundFunctionWrapper_Type, descriptor,
2122
- obj, self->wrapper, self->enabled, self->binding,
2123
- self->parent, NULL);
2124
-
2125
- Py_XDECREF(bound_type);
2126
- Py_DECREF(descriptor);
2127
-
2128
- return result;
2129
- }
2130
-
2131
- Py_INCREF(self);
2132
- return (PyObject *)self;
2133
- }
2134
-
2135
- /* ------------------------------------------------------------------------- */
2136
-
2137
- static PyObject *WraptFunctionWrapperBase_get_self_instance(
2138
- WraptFunctionWrapperObject *self, void *closure)
2139
- {
2140
- if (!self->instance) {
2141
- Py_INCREF(Py_None);
2142
- return Py_None;
2143
- }
2144
-
2145
- Py_INCREF(self->instance);
2146
- return self->instance;
2147
- }
2148
-
2149
- /* ------------------------------------------------------------------------- */
2150
-
2151
- static PyObject *WraptFunctionWrapperBase_get_self_wrapper(
2152
- WraptFunctionWrapperObject *self, void *closure)
2153
- {
2154
- if (!self->wrapper) {
2155
- Py_INCREF(Py_None);
2156
- return Py_None;
2157
- }
2158
-
2159
- Py_INCREF(self->wrapper);
2160
- return self->wrapper;
2161
- }
2162
-
2163
- /* ------------------------------------------------------------------------- */
2164
-
2165
- static PyObject *WraptFunctionWrapperBase_get_self_enabled(
2166
- WraptFunctionWrapperObject *self, void *closure)
2167
- {
2168
- if (!self->enabled) {
2169
- Py_INCREF(Py_None);
2170
- return Py_None;
2171
- }
2172
-
2173
- Py_INCREF(self->enabled);
2174
- return self->enabled;
2175
- }
2176
-
2177
- /* ------------------------------------------------------------------------- */
2178
-
2179
- static PyObject *WraptFunctionWrapperBase_get_self_binding(
2180
- WraptFunctionWrapperObject *self, void *closure)
2181
- {
2182
- if (!self->binding) {
2183
- Py_INCREF(Py_None);
2184
- return Py_None;
2185
- }
2186
-
2187
- Py_INCREF(self->binding);
2188
- return self->binding;
2189
- }
2190
-
2191
- /* ------------------------------------------------------------------------- */
2192
-
2193
- static PyObject *WraptFunctionWrapperBase_get_self_parent(
2194
- WraptFunctionWrapperObject *self, void *closure)
2195
- {
2196
- if (!self->parent) {
2197
- Py_INCREF(Py_None);
2198
- return Py_None;
2199
- }
2200
-
2201
- Py_INCREF(self->parent);
2202
- return self->parent;
2203
- }
2204
-
2205
- /* ------------------------------------------------------------------------- */;
2206
-
2207
- static PyGetSetDef WraptFunctionWrapperBase_getset[] = {
2208
- { "__module__", (getter)WraptObjectProxy_get_module,
2209
- (setter)WraptObjectProxy_set_module, 0 },
2210
- { "__doc__", (getter)WraptObjectProxy_get_doc,
2211
- (setter)WraptObjectProxy_set_doc, 0 },
2212
- { "_self_instance", (getter)WraptFunctionWrapperBase_get_self_instance,
2213
- NULL, 0 },
2214
- { "_self_wrapper", (getter)WraptFunctionWrapperBase_get_self_wrapper,
2215
- NULL, 0 },
2216
- { "_self_enabled", (getter)WraptFunctionWrapperBase_get_self_enabled,
2217
- NULL, 0 },
2218
- { "_self_binding", (getter)WraptFunctionWrapperBase_get_self_binding,
2219
- NULL, 0 },
2220
- { "_self_parent", (getter)WraptFunctionWrapperBase_get_self_parent,
2221
- NULL, 0 },
2222
- { NULL },
2223
- };
2224
-
2225
- PyTypeObject WraptFunctionWrapperBase_Type = {
2226
- PyVarObject_HEAD_INIT(NULL, 0)
2227
- "_FunctionWrapperBase", /*tp_name*/
2228
- sizeof(WraptFunctionWrapperObject), /*tp_basicsize*/
2229
- 0, /*tp_itemsize*/
2230
- /* methods */
2231
- (destructor)WraptFunctionWrapperBase_dealloc, /*tp_dealloc*/
2232
- 0, /*tp_print*/
2233
- 0, /*tp_getattr*/
2234
- 0, /*tp_setattr*/
2235
- 0, /*tp_compare*/
2236
- 0, /*tp_repr*/
2237
- 0, /*tp_as_number*/
2238
- 0, /*tp_as_sequence*/
2239
- 0, /*tp_as_mapping*/
2240
- 0, /*tp_hash*/
2241
- (ternaryfunc)WraptFunctionWrapperBase_call, /*tp_call*/
2242
- 0, /*tp_str*/
2243
- 0, /*tp_getattro*/
2244
- 0, /*tp_setattro*/
2245
- 0, /*tp_as_buffer*/
2246
- #if PY_MAJOR_VERSION < 3
2247
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
2248
- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/
2249
- #else
2250
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
2251
- Py_TPFLAGS_HAVE_GC, /*tp_flags*/
2252
- #endif
2253
- 0, /*tp_doc*/
2254
- (traverseproc)WraptFunctionWrapperBase_traverse, /*tp_traverse*/
2255
- (inquiry)WraptFunctionWrapperBase_clear, /*tp_clear*/
2256
- 0, /*tp_richcompare*/
2257
- offsetof(WraptObjectProxyObject, weakreflist), /*tp_weaklistoffset*/
2258
- 0, /*tp_iter*/
2259
- 0, /*tp_iternext*/
2260
- 0, /*tp_methods*/
2261
- 0, /*tp_members*/
2262
- WraptFunctionWrapperBase_getset, /*tp_getset*/
2263
- 0, /*tp_base*/
2264
- 0, /*tp_dict*/
2265
- (descrgetfunc)WraptFunctionWrapperBase_descr_get, /*tp_descr_get*/
2266
- 0, /*tp_descr_set*/
2267
- 0, /*tp_dictoffset*/
2268
- (initproc)WraptFunctionWrapperBase_init, /*tp_init*/
2269
- 0, /*tp_alloc*/
2270
- WraptFunctionWrapperBase_new, /*tp_new*/
2271
- 0, /*tp_free*/
2272
- 0, /*tp_is_gc*/
2273
- };
2274
-
2275
- /* ------------------------------------------------------------------------- */
2276
-
2277
- static PyObject *WraptBoundFunctionWrapper_call(
2278
- WraptFunctionWrapperObject *self, PyObject *args, PyObject *kwds)
2279
- {
2280
- PyObject *param_args = NULL;
2281
- PyObject *param_kwds = NULL;
2282
-
2283
- PyObject *wrapped = NULL;
2284
- PyObject *instance = NULL;
2285
-
2286
- PyObject *result = NULL;
2287
-
2288
- static PyObject *function_str = NULL;
2289
-
2290
- if (self->enabled != Py_None) {
2291
- if (PyCallable_Check(self->enabled)) {
2292
- PyObject *object = NULL;
2293
-
2294
- object = PyObject_CallFunctionObjArgs(self->enabled, NULL);
2295
-
2296
- if (!object)
2297
- return NULL;
2298
-
2299
- if (PyObject_Not(object)) {
2300
- Py_DECREF(object);
2301
- return PyObject_Call(self->object_proxy.wrapped, args, kwds);
2302
- }
2303
-
2304
- Py_DECREF(object);
2305
- }
2306
- else if (PyObject_Not(self->enabled)) {
2307
- return PyObject_Call(self->object_proxy.wrapped, args, kwds);
2308
- }
2309
- }
2310
-
2311
- if (!function_str) {
2312
- #if PY_MAJOR_VERSION >= 3
2313
- function_str = PyUnicode_InternFromString("function");
2314
- #else
2315
- function_str = PyString_InternFromString("function");
2316
- #endif
2317
- }
2318
-
2319
- /*
2320
- * We need to do things different depending on whether we are likely
2321
- * wrapping an instance method vs a static method or class method.
2322
- */
2323
-
2324
- if (self->binding == function_str || PyObject_RichCompareBool(
2325
- self->binding, function_str, Py_EQ) == 1) {
2326
-
2327
- if (self->instance == Py_None) {
2328
- /*
2329
- * This situation can occur where someone is calling the
2330
- * instancemethod via the class type and passing the
2331
- * instance as the first argument. We need to shift the args
2332
- * before making the call to the wrapper and effectively
2333
- * bind the instance to the wrapped function using a partial
2334
- * so the wrapper doesn't see anything as being different.
2335
- */
2336
-
2337
- PyObject *module = NULL;
2338
- PyObject *dict = NULL;
2339
- PyObject *partial = NULL;
2340
-
2341
- if (PyTuple_Size(args) == 0) {
2342
- PyErr_SetString(PyExc_TypeError,
2343
- "missing 1 required positional argument");
2344
- return NULL;
2345
- }
2346
-
2347
- module = PyImport_ImportModule("functools");
2348
-
2349
- if (!module)
2350
- return NULL;
2351
-
2352
- dict = PyModule_GetDict(module);
2353
- partial = PyDict_GetItemString(dict, "partial");
2354
-
2355
- if (!partial) {
2356
- Py_DECREF(module);
2357
- return NULL;
2358
- }
2359
-
2360
- Py_INCREF(partial);
2361
- Py_DECREF(module);
2362
-
2363
- instance = PyTuple_GetItem(args, 0);
2364
-
2365
- if (!instance) {
2366
- Py_DECREF(partial);
2367
- return NULL;
2368
- }
2369
-
2370
- wrapped = PyObject_CallFunctionObjArgs(partial,
2371
- self->object_proxy.wrapped, instance, NULL);
2372
-
2373
- Py_DECREF(partial);
2374
-
2375
- if (!wrapped)
2376
- return NULL;
2377
-
2378
- param_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
2379
-
2380
- if (!param_args) {
2381
- Py_DECREF(wrapped);
2382
- return NULL;
2383
- }
2384
-
2385
- args = param_args;
2386
- }
2387
- else
2388
- instance = self->instance;
2389
-
2390
- if (!wrapped) {
2391
- Py_INCREF(self->object_proxy.wrapped);
2392
- wrapped = self->object_proxy.wrapped;
2393
- }
2394
-
2395
- if (!kwds) {
2396
- param_kwds = PyDict_New();
2397
- kwds = param_kwds;
2398
- }
2399
-
2400
- result = PyObject_CallFunctionObjArgs(self->wrapper, wrapped,
2401
- instance, args, kwds, NULL);
2402
-
2403
- Py_XDECREF(param_args);
2404
- Py_XDECREF(param_kwds);
2405
- Py_DECREF(wrapped);
2406
-
2407
- return result;
2408
- }
2409
- else {
2410
- /*
2411
- * As in this case we would be dealing with a classmethod or
2412
- * staticmethod, then _self_instance will only tell us whether
2413
- * when calling the classmethod or staticmethod they did it via
2414
- * an instance of the class it is bound to and not the case
2415
- * where done by the class type itself. We thus ignore
2416
- * _self_instance and use the __self__ attribute of the bound
2417
- * function instead. For a classmethod, this means instance will
2418
- * be the class type and for a staticmethod it will be None.
2419
- * This is probably the more useful thing we can pass through
2420
- * even though we loose knowledge of whether they were called on
2421
- * the instance vs the class type, as it reflects what they have
2422
- * available in the decoratored function.
2423
- */
2424
-
2425
- instance = PyObject_GetAttrString(self->object_proxy.wrapped,
2426
- "__self__");
2427
-
2428
- if (!instance) {
2429
- PyErr_Clear();
2430
- Py_INCREF(Py_None);
2431
- instance = Py_None;
2432
- }
2433
-
2434
- if (!kwds) {
2435
- param_kwds = PyDict_New();
2436
- kwds = param_kwds;
2437
- }
2438
-
2439
- result = PyObject_CallFunctionObjArgs(self->wrapper,
2440
- self->object_proxy.wrapped, instance, args, kwds, NULL);
2441
-
2442
- Py_XDECREF(param_kwds);
2443
-
2444
- Py_DECREF(instance);
2445
-
2446
- return result;
2447
- }
2448
- }
2449
-
2450
- /* ------------------------------------------------------------------------- */
2451
-
2452
- static PyGetSetDef WraptBoundFunctionWrapper_getset[] = {
2453
- { "__module__", (getter)WraptObjectProxy_get_module,
2454
- (setter)WraptObjectProxy_set_module, 0 },
2455
- { "__doc__", (getter)WraptObjectProxy_get_doc,
2456
- (setter)WraptObjectProxy_set_doc, 0 },
2457
- { NULL },
2458
- };
2459
-
2460
- PyTypeObject WraptBoundFunctionWrapper_Type = {
2461
- PyVarObject_HEAD_INIT(NULL, 0)
2462
- "BoundFunctionWrapper", /*tp_name*/
2463
- sizeof(WraptFunctionWrapperObject), /*tp_basicsize*/
2464
- 0, /*tp_itemsize*/
2465
- /* methods */
2466
- 0, /*tp_dealloc*/
2467
- 0, /*tp_print*/
2468
- 0, /*tp_getattr*/
2469
- 0, /*tp_setattr*/
2470
- 0, /*tp_compare*/
2471
- 0, /*tp_repr*/
2472
- 0, /*tp_as_number*/
2473
- 0, /*tp_as_sequence*/
2474
- 0, /*tp_as_mapping*/
2475
- 0, /*tp_hash*/
2476
- (ternaryfunc)WraptBoundFunctionWrapper_call, /*tp_call*/
2477
- 0, /*tp_str*/
2478
- 0, /*tp_getattro*/
2479
- 0, /*tp_setattro*/
2480
- 0, /*tp_as_buffer*/
2481
- #if PY_MAJOR_VERSION < 3
2482
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/
2483
- #else
2484
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
2485
- #endif
2486
- 0, /*tp_doc*/
2487
- 0, /*tp_traverse*/
2488
- 0, /*tp_clear*/
2489
- 0, /*tp_richcompare*/
2490
- offsetof(WraptObjectProxyObject, weakreflist), /*tp_weaklistoffset*/
2491
- 0, /*tp_iter*/
2492
- 0, /*tp_iternext*/
2493
- 0, /*tp_methods*/
2494
- 0, /*tp_members*/
2495
- WraptBoundFunctionWrapper_getset, /*tp_getset*/
2496
- 0, /*tp_base*/
2497
- 0, /*tp_dict*/
2498
- 0, /*tp_descr_get*/
2499
- 0, /*tp_descr_set*/
2500
- 0, /*tp_dictoffset*/
2501
- 0, /*tp_init*/
2502
- 0, /*tp_alloc*/
2503
- 0, /*tp_new*/
2504
- 0, /*tp_free*/
2505
- 0, /*tp_is_gc*/
2506
- };
2507
-
2508
- /* ------------------------------------------------------------------------- */
2509
-
2510
- static int WraptFunctionWrapper_init(WraptFunctionWrapperObject *self,
2511
- PyObject *args, PyObject *kwds)
2512
- {
2513
- PyObject *wrapped = NULL;
2514
- PyObject *wrapper = NULL;
2515
- PyObject *enabled = Py_None;
2516
- PyObject *binding = NULL;
2517
- PyObject *instance = NULL;
2518
-
2519
- static PyObject *classmethod_str = NULL;
2520
- static PyObject *staticmethod_str = NULL;
2521
- static PyObject *function_str = NULL;
2522
-
2523
- int result = 0;
2524
-
2525
- static char *kwlist[] = { "wrapped", "wrapper", "enabled", NULL };
2526
-
2527
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|O:FunctionWrapper",
2528
- kwlist, &wrapped, &wrapper, &enabled)) {
2529
- return -1;
2530
- }
2531
-
2532
- if (!classmethod_str) {
2533
- #if PY_MAJOR_VERSION >= 3
2534
- classmethod_str = PyUnicode_InternFromString("classmethod");
2535
- #else
2536
- classmethod_str = PyString_InternFromString("classmethod");
2537
- #endif
2538
- }
2539
-
2540
- if (!staticmethod_str) {
2541
- #if PY_MAJOR_VERSION >= 3
2542
- staticmethod_str = PyUnicode_InternFromString("staticmethod");
2543
- #else
2544
- staticmethod_str = PyString_InternFromString("staticmethod");
2545
- #endif
2546
- }
2547
-
2548
- if (!function_str) {
2549
- #if PY_MAJOR_VERSION >= 3
2550
- function_str = PyUnicode_InternFromString("function");
2551
- #else
2552
- function_str = PyString_InternFromString("function");
2553
- #endif
2554
- }
2555
-
2556
- if (PyObject_IsInstance(wrapped, (PyObject *)&PyClassMethod_Type)) {
2557
- binding = classmethod_str;
2558
- }
2559
- else if (PyObject_IsInstance(wrapped, (PyObject *)&PyStaticMethod_Type)) {
2560
- binding = staticmethod_str;
2561
- }
2562
- else if ((instance = PyObject_GetAttrString(wrapped, "__self__")) != 0) {
2563
- #if PY_MAJOR_VERSION < 3
2564
- if (PyObject_IsInstance(instance, (PyObject *)&PyClass_Type) ||
2565
- PyObject_IsInstance(instance, (PyObject *)&PyType_Type)) {
2566
- binding = classmethod_str;
2567
- }
2568
- #else
2569
- if (PyObject_IsInstance(instance, (PyObject *)&PyType_Type)) {
2570
- binding = classmethod_str;
2571
- }
2572
- #endif
2573
- else
2574
- binding = function_str;
2575
-
2576
- Py_DECREF(instance);
2577
- }
2578
- else {
2579
- PyErr_Clear();
2580
-
2581
- binding = function_str;
2582
- }
2583
-
2584
- result = WraptFunctionWrapperBase_raw_init(self, wrapped, Py_None,
2585
- wrapper, enabled, binding, Py_None);
2586
-
2587
- return result;
2588
- }
2589
-
2590
- /* ------------------------------------------------------------------------- */
2591
-
2592
- static PyGetSetDef WraptFunctionWrapper_getset[] = {
2593
- { "__module__", (getter)WraptObjectProxy_get_module,
2594
- (setter)WraptObjectProxy_set_module, 0 },
2595
- { "__doc__", (getter)WraptObjectProxy_get_doc,
2596
- (setter)WraptObjectProxy_set_doc, 0 },
2597
- { NULL },
2598
- };
2599
-
2600
- PyTypeObject WraptFunctionWrapper_Type = {
2601
- PyVarObject_HEAD_INIT(NULL, 0)
2602
- "FunctionWrapper", /*tp_name*/
2603
- sizeof(WraptFunctionWrapperObject), /*tp_basicsize*/
2604
- 0, /*tp_itemsize*/
2605
- /* methods */
2606
- 0, /*tp_dealloc*/
2607
- 0, /*tp_print*/
2608
- 0, /*tp_getattr*/
2609
- 0, /*tp_setattr*/
2610
- 0, /*tp_compare*/
2611
- 0, /*tp_repr*/
2612
- 0, /*tp_as_number*/
2613
- 0, /*tp_as_sequence*/
2614
- 0, /*tp_as_mapping*/
2615
- 0, /*tp_hash*/
2616
- 0, /*tp_call*/
2617
- 0, /*tp_str*/
2618
- 0, /*tp_getattro*/
2619
- 0, /*tp_setattro*/
2620
- 0, /*tp_as_buffer*/
2621
- #if PY_MAJOR_VERSION < 3
2622
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/
2623
- #else
2624
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
2625
- #endif
2626
- 0, /*tp_doc*/
2627
- 0, /*tp_traverse*/
2628
- 0, /*tp_clear*/
2629
- 0, /*tp_richcompare*/
2630
- offsetof(WraptObjectProxyObject, weakreflist), /*tp_weaklistoffset*/
2631
- 0, /*tp_iter*/
2632
- 0, /*tp_iternext*/
2633
- 0, /*tp_methods*/
2634
- 0, /*tp_members*/
2635
- WraptFunctionWrapper_getset, /*tp_getset*/
2636
- 0, /*tp_base*/
2637
- 0, /*tp_dict*/
2638
- 0, /*tp_descr_get*/
2639
- 0, /*tp_descr_set*/
2640
- 0, /*tp_dictoffset*/
2641
- (initproc)WraptFunctionWrapper_init, /*tp_init*/
2642
- 0, /*tp_alloc*/
2643
- 0, /*tp_new*/
2644
- 0, /*tp_free*/
2645
- 0, /*tp_is_gc*/
2646
- };
2647
-
2648
- /* ------------------------------------------------------------------------- */
2649
-
2650
- #if PY_MAJOR_VERSION >= 3
2651
- static struct PyModuleDef moduledef = {
2652
- PyModuleDef_HEAD_INIT,
2653
- "_wrappers", /* m_name */
2654
- NULL, /* m_doc */
2655
- -1, /* m_size */
2656
- NULL, /* m_methods */
2657
- NULL, /* m_reload */
2658
- NULL, /* m_traverse */
2659
- NULL, /* m_clear */
2660
- NULL, /* m_free */
2661
- };
2662
- #endif
2663
-
2664
- static PyObject *
2665
- moduleinit(void)
2666
- {
2667
- PyObject *module;
2668
-
2669
- #if PY_MAJOR_VERSION >= 3
2670
- module = PyModule_Create(&moduledef);
2671
- #else
2672
- module = Py_InitModule3("_wrappers", NULL, NULL);
2673
- #endif
2674
-
2675
- if (module == NULL)
2676
- return NULL;
2677
-
2678
- if (PyType_Ready(&WraptObjectProxy_Type) < 0)
2679
- return NULL;
2680
-
2681
- /* Ensure that inheritance relationships specified. */
2682
-
2683
- WraptCallableObjectProxy_Type.tp_base = &WraptObjectProxy_Type;
2684
- WraptFunctionWrapperBase_Type.tp_base = &WraptObjectProxy_Type;
2685
- WraptBoundFunctionWrapper_Type.tp_base = &WraptFunctionWrapperBase_Type;
2686
- WraptFunctionWrapper_Type.tp_base = &WraptFunctionWrapperBase_Type;
2687
-
2688
- if (PyType_Ready(&WraptCallableObjectProxy_Type) < 0)
2689
- return NULL;
2690
- if (PyType_Ready(&WraptFunctionWrapperBase_Type) < 0)
2691
- return NULL;
2692
- if (PyType_Ready(&WraptBoundFunctionWrapper_Type) < 0)
2693
- return NULL;
2694
- if (PyType_Ready(&WraptFunctionWrapper_Type) < 0)
2695
- return NULL;
2696
-
2697
- Py_INCREF(&WraptObjectProxy_Type);
2698
- PyModule_AddObject(module, "ObjectProxy",
2699
- (PyObject *)&WraptObjectProxy_Type);
2700
- Py_INCREF(&WraptCallableObjectProxy_Type);
2701
- PyModule_AddObject(module, "CallableObjectProxy",
2702
- (PyObject *)&WraptCallableObjectProxy_Type);
2703
- Py_INCREF(&WraptFunctionWrapper_Type);
2704
- PyModule_AddObject(module, "FunctionWrapper",
2705
- (PyObject *)&WraptFunctionWrapper_Type);
2706
-
2707
- Py_INCREF(&WraptFunctionWrapperBase_Type);
2708
- PyModule_AddObject(module, "_FunctionWrapperBase",
2709
- (PyObject *)&WraptFunctionWrapperBase_Type);
2710
- Py_INCREF(&WraptBoundFunctionWrapper_Type);
2711
- PyModule_AddObject(module, "BoundFunctionWrapper",
2712
- (PyObject *)&WraptBoundFunctionWrapper_Type);
2713
-
2714
- return module;
2715
- }
2716
-
2717
- #if PY_MAJOR_VERSION < 3
2718
- PyMODINIT_FUNC init_wrappers(void)
2719
- {
2720
- moduleinit();
2721
- }
2722
- #else
2723
- PyMODINIT_FUNC PyInit__wrappers(void)
2724
- {
2725
- return moduleinit();
2726
- }
2727
- #endif
2728
-
2729
- /* ------------------------------------------------------------------------- */