|
| 1 | +# ============================================================================== |
| 2 | +# Authors: Patrick Lehmann |
| 3 | +# |
| 4 | +# Python Module: |
| 5 | +# |
| 6 | +# Description: |
| 7 | +# ------------------------------------ |
| 8 | +# - TODO |
| 9 | +# |
| 10 | +# License: |
| 11 | +# ============================================================================== |
| 12 | +# Copyright 2007-2016 Patrick Lehmann - Dresden, Germany |
| 13 | +# |
| 14 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 15 | +# you may not use this file except in compliance with the License. |
| 16 | +# You may obtain a copy of the License at |
| 17 | +# |
| 18 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 19 | +# |
| 20 | +# Unless required by applicable law or agreed to in writing, software |
| 21 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 22 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 23 | +# See the License for the specific language governing permissions and |
| 24 | +# limitations under the License. |
| 25 | +# ============================================================================== |
| 26 | +# |
| 27 | +from SphinxExtensions import DocumentMemberAttribute |
| 28 | + |
| 29 | + |
| 30 | +def skip_member_handler(app, what, name, obj, skip, options): |
| 31 | + # try: |
| 32 | + # print("skip_member_handler: ", obj) |
| 33 | + # except: |
| 34 | + # print("skip_member_handler: ERROR") |
| 35 | + |
| 36 | + try: |
| 37 | + attributes = DocumentMemberAttribute.GetAttributes(obj) |
| 38 | + if (len(attributes) > 0): |
| 39 | + # print("*#"*20) |
| 40 | + # try: |
| 41 | + # print("skip_member_handler: ", obj) |
| 42 | + # except: |
| 43 | + # print("skip_member_handler: ERROR") |
| 44 | + |
| 45 | + return not attributes[0].value |
| 46 | + except: |
| 47 | + pass |
| 48 | + return None |
| 49 | + |
| 50 | +def setup(app): |
| 51 | + app.connect('autodoc-skip-member', skip_member_handler) |
0 commit comments