diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-04-08 10:57:37 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 10:57:37 +0900 |
commit | 01cac597e3ca6daf2a5a702107e8dd6597090802 (patch) | |
tree | 5cd9f57808fe4dd067b1d75d840157c8d5129e63 /sphinx/application.py | |
parent | 245b3c32df1965b6bd5952cf25e19beef965a01b (diff) | |
parent | eb68c237dddbceecb7a295642e51e4ac8a5b36c2 (diff) | |
download | sphinx-git-01cac597e3ca6daf2a5a702107e8dd6597090802.tar.gz |
Merge pull request #9057 from tk0miya/refactor_vartypes
refactor: Use PEP-526 based variable annotation
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index 9878a3e71..ef77e34db 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -140,12 +140,12 @@ class Sphinx: verbosity: int = 0, parallel: int = 0, keep_going: bool = False) -> None: self.phase = BuildPhase.INITIALIZATION self.verbosity = verbosity - self.extensions = {} # type: Dict[str, Extension] - self.builder = None # type: Builder - self.env = None # type: BuildEnvironment - self.project = None # type: Project + self.extensions: Dict[str, Extension] = {} + self.builder: Builder = None + self.env: BuildEnvironment = None + self.project: Project = None self.registry = SphinxComponentRegistry() - self.html_themes = {} # type: Dict[str, str] + self.html_themes: Dict[str, str] = {} # validate provided directories self.srcdir = abspath(srcdir) @@ -173,14 +173,14 @@ class Sphinx: self.parallel = parallel if status is None: - self._status = StringIO() # type: IO + self._status: IO = StringIO() self.quiet = True else: self._status = status self.quiet = False if warning is None: - self._warning = StringIO() # type: IO + self._warning: IO = StringIO() else: self._warning = warning self._warncount = 0 @@ -195,7 +195,7 @@ class Sphinx: # keep last few messages for traceback # This will be filled by sphinx.util.logging.LastMessagesWriter - self.messagelog = deque(maxlen=10) # type: deque + self.messagelog: deque = deque(maxlen=10) # say hello to the world logger.info(bold(__('Running Sphinx v%s') % sphinx.__display_version__)) @@ -292,7 +292,7 @@ class Sphinx: if catalog.domain == 'sphinx' and catalog.is_outdated(): catalog.write_mo(self.config.language) - locale_dirs = list(repo.locale_dirs) # type: List[Optional[str]] + locale_dirs: List[Optional[str]] = list(repo.locale_dirs) locale_dirs += [None] locale_dirs += [path.join(package_dir, 'locale')] |