Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
enable passing verbosity flag to sphinx
  • Loading branch information
jorisvandenbossche committed Mar 1, 2018
commit c33b65c71b32b80574d6ead363c02ece4bfe5f02
15 changes: 11 additions & 4 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ class DocBuilder:
All public methods of this class can be called as parameters of the
script.
"""
def __init__(self, num_jobs=1, include_api=True, single_doc=None):
def __init__(self, num_jobs=1, include_api=True, single_doc=None,
verbosity=0):
self.num_jobs = num_jobs
self.include_api = include_api
self.verbosity = verbosity
self.single_doc = None
self.single_doc_type = None
if single_doc is not None:
Expand Down Expand Up @@ -229,6 +231,8 @@ def _sphinx_build(self, kind):
self._run_os('sphinx-build',
'-j{}'.format(self.num_jobs),
'-b{}'.format(kind),
'-{}'.format(
'v' * self.verbosity) if self.verbosity else '',
'-d{}'.format(os.path.join(BUILD_PATH, 'doctrees')),
'-Dexclude_patterns={}'.format(self.exclude_patterns),
SOURCE_PATH,
Expand Down Expand Up @@ -330,6 +334,9 @@ def main():
type=str,
default=os.path.join(DOC_PATH, '..'),
help='path')
argparser.add_argument('-v', action='count', dest='verbosity', default=0,
help=('increase verbosity (can be repeated), '
'passed to the sphinx build command'))
args = argparser.parse_args()

if args.command not in cmds:
Expand All @@ -338,9 +345,9 @@ def main():

os.environ['PYTHONPATH'] = args.python_path

getattr(DocBuilder(args.num_jobs,
not args.no_api,
args.single), args.command)()
builder = DocBuilder(args.num_jobs, not args.no_api, args.single,
args.verbosity)
getattr(builder, args.command)()


if __name__ == '__main__':
Expand Down