| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,15 +8,18 @@ | |||
| 8 | 8 | import inspect | |
| 9 | 9 | import os | |
| 10 | 10 | import sys | |
| 11 | - | ||
| 12 | 11 | import os.path as osp | |
| 13 | 12 | ||
| 13 | + from typing import Optional | ||
| 14 | + from git.types import PathLike | ||
| 14 | 15 | ||
| 15 | 16 | __version__ = 'git' | |
| 16 | 17 | ||
| 17 | 18 | ||
| 19 | + | ||
| 20 | + | ||
| 18 | 21 | #{ Initialization | |
| 19 | - def _init_externals(): | ||
| 22 | + def _init_externals() -> None: | ||
| 20 | 23 | """Initialize external projects by putting them into the path""" | |
| 21 | 24 | if __version__ == 'git' and 'PYOXIDIZER' not in os.environ: | |
| 22 | 25 | sys.path.insert(1, osp.join(osp.dirname(__file__), 'ext', 'gitdb')) | |
@@ -65,7 +68,7 @@ def _init_externals(): | |||
| 65 | 68 | #{ Initialize git executable path | |
| 66 | 69 | GIT_OK = None | |
| 67 | 70 | ||
| 68 | - def refresh(path=None): | ||
| 71 | + def refresh(path:Optional[PathLike]=None) -> None: | ||
| 69 | 72 | """Convenience method for setting the git executable path.""" | |
| 70 | 73 | global GIT_OK | |
| 71 | 74 | GIT_OK = False | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,6 +34,9 @@ | |||
| 34 | 34 | TagReference | |
| 35 | 35 | ) | |
| 36 | 36 | ||
| 37 | + # typing------------------------------------------------------- | ||
| 38 | + | ||
| 39 | + from git.repo.Base import Repo | ||
| 37 | 40 | ||
| 38 | 41 | log = logging.getLogger('git.remote') | |
| 39 | 42 | log.addHandler(logging.NullHandler()) | |
@@ -403,7 +406,7 @@ def __init__(self, repo, name): | |||
| 403 | 406 | ||
| 404 | 407 | :param repo: The repository we are a remote of | |
| 405 | 408 | :param name: the name of the remote, i.e. 'origin'""" | |
| 406 | - self.repo = repo | ||
| 409 | + self.repo = repo # type: 'Repo' | ||
| 407 | 410 | self.name = name | |
| 408 | 411 | ||
| 409 | 412 | if is_win: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments