forked from sphinx-doc/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sphinx-doc#4077 from stephenfin/move-sphinx-build-…
…to-module sphinx-build: Move code out of 'sphinx.__init__'
- Loading branch information
Showing
9 changed files
with
808 additions
and
767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
sphinx.cmd | ||
~~~~~~~~~~ | ||
Modules for command line executables. | ||
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. | ||
:license: BSD, see LICENSE for details. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
sphinx.cmd.build | ||
~~~~~~~~~~~~~~~~ | ||
Build documentation from a provided source. | ||
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. | ||
:license: BSD, see LICENSE for details. | ||
""" | ||
|
||
import sys | ||
|
||
if False: | ||
# For type annotation | ||
from typing import List # NOQA | ||
|
||
|
||
def build_main(argv=sys.argv[1:]): | ||
# type: (List[str]) -> int | ||
"""Sphinx build "main" command-line entry.""" | ||
from sphinx import cmdline | ||
return cmdline.main(argv) # type: ignore | ||
|
||
|
||
def make_main(argv=sys.argv[1:]): | ||
# type: (List[str]) -> int | ||
"""Sphinx build "make mode" entry.""" | ||
from sphinx import make_mode | ||
return make_mode.run_make_mode(argv[1:]) # type: ignore | ||
|
||
|
||
def main(argv=sys.argv[1:]): | ||
# type: (List[str]) -> int | ||
if sys.argv[1:2] == ['-M']: | ||
return make_main(argv) | ||
else: | ||
return build_main(argv) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main(sys.argv[1:])) |
Oops, something went wrong.