| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The LUCI Authors. All rights reserved. | 2 # Copyright 2013 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
| 5 | 5 |
| 6 from __future__ import print_function | 6 from __future__ import print_function |
| 7 | 7 |
| 8 import collections | 8 import collections |
| 9 import inspect | 9 import inspect |
| 10 import os | 10 import os |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 from . import loader | 13 from . import loader |
| 14 from . import run as recipe_run | 14 from . import run as recipe_run |
| 15 from . import package | |
| 16 from . import recipe_api | 15 from . import recipe_api |
| 17 | 16 |
| 18 def trim_doc(docstring): | 17 def trim_doc(docstring): |
| 19 """From PEP 257""" | 18 """From PEP 257""" |
| 20 if not docstring: | 19 if not docstring: |
| 21 return '' | 20 return '' |
| 22 # Convert tabs to spaces (following the normal Python rules) | 21 # Convert tabs to spaces (following the normal Python rules) |
| 23 # and split into a list of lines: | 22 # and split into a list of lines: |
| 24 lines = docstring.expandtabs().splitlines() | 23 lines = docstring.expandtabs().splitlines() |
| 25 # Determine minimum indentation (first line doesn't count): | 24 # Determine minimum indentation (first line doesn't count): |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 p(1, 'behaves like %s' % map_to_cool_name(cool_base)) | 119 p(1, 'behaves like %s' % map_to_cool_name(cool_base)) |
| 121 | 120 |
| 122 if mod.API.__doc__: | 121 if mod.API.__doc__: |
| 123 for line in trim_doc(mod.API.__doc__): | 122 for line in trim_doc(mod.API.__doc__): |
| 124 p(2, '"', line) | 123 p(2, '"', line) |
| 125 | 124 |
| 126 for fn_name, obj in member_iter(subinst): | 125 for fn_name, obj in member_iter(subinst): |
| 127 if fn_name in base_fns: | 126 if fn_name in base_fns: |
| 128 continue | 127 continue |
| 129 pmethod(1, fn_name, obj) | 128 pmethod(1, fn_name, obj) |
| OLD | NEW |