Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: recipe_engine/doc.py

Issue 2702313003: Remove unused imports and fix some other linter errors. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « recipe_engine/depgraph.py ('k') | recipe_engine/fetch.py » ('j') | recipe_engine/package.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698