| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 74f3c2e commit 5778b7a
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,12 +4,13 @@ | |||
| 4 | 4 | # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ | |
| 5 | 5 | ||
| 6 | 6 | from mimetypes import guess_type | |
| 7 | - from . import base | ||
| 7 | + import sys | ||
| 8 | 8 | ||
| 9 | + from . import base | ||
| 9 | 10 | ||
| 10 | - try: | ||
| 11 | + if sys.version_info >= (3, 8): | ||
| 11 | 12 | from typing import Literal | |
| 12 | - except ImportError: | ||
| 13 | + else: | ||
| 13 | 14 | from typing_extensions import Literal | |
| 14 | 15 | ||
| 15 | 16 | __all__ = ("Blob",) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,57 +3,57 @@ | |||
| 3 | 3 | # This module is part of GitPython and is released under the | |
| 4 | 4 | # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ | |
| 5 | 5 | ||
| 6 | + from collections import defaultdict | ||
| 6 | 7 | import datetime | |
| 8 | + from io import BytesIO | ||
| 9 | + import logging | ||
| 10 | + import os | ||
| 7 | 11 | import re | |
| 8 | 12 | from subprocess import Popen, PIPE | |
| 13 | + import sys | ||
| 14 | + from time import altzone, daylight, localtime, time, timezone | ||
| 15 | + | ||
| 9 | 16 | from gitdb import IStream | |
| 10 | - from git.util import hex_to_bin, Actor, Stats, finalize_process | ||
| 11 | - from git.diff import Diffable | ||
| 12 | 17 | from git.cmd import Git | |
| 18 | + from git.diff import Diffable | ||
| 19 | + from git.util import hex_to_bin, Actor, Stats, finalize_process | ||
| 13 | 20 | ||
| 14 | 21 | from .tree import Tree | |
| 15 | - from . import base | ||
| 16 | 22 | from .util import ( | |
| 17 | 23 | Serializable, | |
| 18 | 24 | TraversableIterableObj, | |
| 19 | - parse_date, | ||
| 20 | 25 | altz_to_utctz_str, | |
| 21 | - parse_actor_and_date, | ||
| 22 | 26 | from_timestamp, | |
| 27 | + parse_actor_and_date, | ||
| 28 | + parse_date, | ||
| 23 | 29 | ) | |
| 24 | - | ||
| 25 | - from time import time, daylight, altzone, timezone, localtime | ||
| 26 | - import os | ||
| 27 | - from io import BytesIO | ||
| 28 | - import logging | ||
| 29 | - from collections import defaultdict | ||
| 30 | - | ||
| 30 | + from . import base | ||
| 31 | 31 | ||
| 32 | 32 | # typing ------------------------------------------------------------------ | |
| 33 | 33 | ||
| 34 | 34 | from typing import ( | |
| 35 | 35 | Any, | |
| 36 | + Dict, | ||
| 36 | 37 | IO, | |
| 37 | 38 | Iterator, | |
| 38 | 39 | List, | |
| 39 | 40 | Sequence, | |
| 40 | 41 | Tuple, | |
| 41 | - Union, | ||
| 42 | 42 | TYPE_CHECKING, | |
| 43 | + Union, | ||
| 43 | 44 | cast, | |
| 44 | - Dict, | ||
| 45 | 45 | ) | |
| 46 | 46 | ||
| 47 | - from git.types import PathLike | ||
| 48 | - | ||
| 49 | - try: | ||
| 47 | + if sys.version_info >= (3, 8): | ||
| 50 | 48 | from typing import Literal | |
| 51 | - except ImportError: | ||
| 49 | + else: | ||
| 52 | 50 | from typing_extensions import Literal | |
| 53 | 51 | ||
| 52 | + from git.types import PathLike | ||
| 53 | + | ||
| 54 | 54 | if TYPE_CHECKING: | |
| 55 | - from git.repo import Repo | ||
| 56 | 55 | from git.refs import SymbolicReference | |
| 56 | + from git.repo import Repo | ||
| 57 | 57 | ||
| 58 | 58 | # ------------------------------------------------------------------------ | |
| 59 | 59 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,6 @@ | |||
| 39 | 39 | sm_section, | |
| 40 | 40 | ) | |
| 41 | 41 | ||
| 42 | - | ||
| 43 | 42 | # typing ---------------------------------------------------------------------- | |
| 44 | 43 | ||
| 45 | 44 | from typing import ( | |
@@ -54,13 +53,13 @@ | |||
| 54 | 53 | cast, | |
| 55 | 54 | ) | |
| 56 | 55 | ||
| 57 | - from git.types import Commit_ish, PathLike, TBD | ||
| 58 | - | ||
| 59 | - try: | ||
| 56 | + if sys.version_info >= (3, 8): | ||
| 60 | 57 | from typing import Literal | |
| 61 | - except ImportError: | ||
| 58 | + else: | ||
| 62 | 59 | from typing_extensions import Literal | |
| 63 | 60 | ||
| 61 | + from git.types import Commit_ish, PathLike, TBD | ||
| 62 | + | ||
| 64 | 63 | if TYPE_CHECKING: | |
| 65 | 64 | from git.index import IndexFile | |
| 66 | 65 | from git.objects.commit import Commit | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,16 +9,18 @@ | |||
| 9 | 9 | For lightweight tags, see the :mod:`git.refs.tag` module. | |
| 10 | 10 | """ | |
| 11 | 11 | ||
| 12 | + import sys | ||
| 13 | + | ||
| 12 | 14 | from . import base | |
| 13 | 15 | from .util import get_object_type_by_name, parse_actor_and_date | |
| 14 | 16 | from ..util import hex_to_bin | |
| 15 | 17 | from ..compat import defenc | |
| 16 | 18 | ||
| 17 | 19 | from typing import List, TYPE_CHECKING, Union | |
| 18 | 20 | ||
| 19 | - try: | ||
| 21 | + if sys.version_info >= (3, 8): | ||
| 20 | 22 | from typing import Literal | |
| 21 | - except ImportError: | ||
| 23 | + else: | ||
| 22 | 24 | from typing_extensions import Literal | |
| 23 | 25 | ||
| 24 | 26 | if TYPE_CHECKING: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,17 +3,16 @@ | |||
| 3 | 3 | # This module is part of GitPython and is released under the | |
| 4 | 4 | # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ | |
| 5 | 5 | ||
| 6 | - from git.util import IterableList, join_path | ||
| 6 | + import sys | ||
| 7 | + | ||
| 7 | 8 | import git.diff as git_diff | |
| 8 | - from git.util import to_bin_sha | ||
| 9 | + from git.util import IterableList, join_path, to_bin_sha | ||
| 9 | 10 | ||
| 10 | - from . import util | ||
| 11 | - from .base import IndexObject, IndexObjUnion | ||
| 11 | + from .base import IndexObjUnion, IndexObject | ||
| 12 | 12 | from .blob import Blob | |
| 13 | - from .submodule.base import Submodule | ||
| 14 | - | ||
| 15 | 13 | from .fun import tree_entries_from_data, tree_to_stream | |
| 16 | - | ||
| 14 | + from .submodule.base import Submodule | ||
| 15 | + from . import util | ||
| 17 | 16 | ||
| 18 | 17 | # typing ------------------------------------------------- | |
| 19 | 18 | ||
@@ -25,22 +24,22 @@ | |||
| 25 | 24 | Iterator, | |
| 26 | 25 | List, | |
| 27 | 26 | Tuple, | |
| 27 | + TYPE_CHECKING, | ||
| 28 | 28 | Type, | |
| 29 | 29 | Union, | |
| 30 | 30 | cast, | |
| 31 | - TYPE_CHECKING, | ||
| 32 | 31 | ) | |
| 33 | 32 | ||
| 34 | - from git.types import PathLike | ||
| 35 | - | ||
| 36 | - try: | ||
| 33 | + if sys.version_info >= (3, 8): | ||
| 37 | 34 | from typing import Literal | |
| 38 | - except ImportError: | ||
| 35 | + else: | ||
| 39 | 36 | from typing_extensions import Literal | |
| 40 | 37 | ||
| 38 | + from git.types import PathLike | ||
| 39 | + | ||
| 41 | 40 | if TYPE_CHECKING: | |
| 42 | - from git.repo import Repo | ||
| 43 | 41 | from io import BytesIO | |
| 42 | + from git.repo import Repo | ||
| 44 | 43 | ||
| 45 | 44 | TreeCacheTup = Tuple[bytes, int, str] | |
| 46 | 45 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments