| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -201,9 +201,9 @@ def patch_env(name: str, value: str) -> Generator[None, None, None]: | |||
| 201 | 201 | def rmtree(path: PathLike) -> None: | |
| 202 | 202 | """Remove the given directory tree recursively. | |
| 203 | 203 | ||
| 204 | - :note: We use :func:`shutil.rmtree` but adjust its behaviour to see whether files | ||
| 205 | - that couldn't be deleted are read-only. Windows will not remove them in that | ||
| 206 | - case. | ||
| 204 | + :note: | ||
| 205 | + We use :func:`shutil.rmtree` but adjust its behaviour to see whether files that | ||
| 206 | + couldn't be deleted are read-only. Windows will not remove them in that case. | ||
| 207 | 207 | """ | |
| 208 | 208 | ||
| 209 | 209 | def handler(function: Callable, path: PathLike, _excinfo: Any) -> None: | |
@@ -241,8 +241,8 @@ def rmfile(path: PathLike) -> None: | |||
| 241 | 241 | ||
| 242 | 242 | ||
| 243 | 243 | def stream_copy(source: BinaryIO, destination: BinaryIO, chunk_size: int = 512 * 1024) -> int: | |
| 244 | - """Copy all data from the source stream into the destination stream in chunks | ||
| 245 | - of size chunk_size. | ||
| 244 | + """Copy all data from the `source` stream into the `destination` stream in chunks | ||
| 245 | + of size `chunk_size`. | ||
| 246 | 246 | ||
| 247 | 247 | :return: | |
| 248 | 248 | Number of bytes written | |
@@ -259,8 +259,8 @@ def stream_copy(source: BinaryIO, destination: BinaryIO, chunk_size: int = 512 * | |||
| 259 | 259 | ||
| 260 | 260 | ||
| 261 | 261 | def join_path(a: PathLike, *p: PathLike) -> PathLike: | |
| 262 | - R"""Join path tokens together similar to osp.join, but always use | ||
| 263 | - ``/`` instead of possibly ``\`` on Windows.""" | ||
| 262 | + R"""Join path tokens together similar to osp.join, but always use ``/`` instead of | ||
| 263 | + possibly ``\`` on Windows.""" | ||
| 264 | 264 | path = str(a) | |
| 265 | 265 | for b in p: | |
| 266 | 266 | b = str(b) | |
@@ -297,7 +297,7 @@ def to_native_path_linux(path: PathLike) -> str: | |||
| 297 | 297 | ||
| 298 | 298 | ||
| 299 | 299 | def join_path_native(a: PathLike, *p: PathLike) -> PathLike: | |
| 300 | - R"""Like join_path, but makes sure an OS native path is returned. | ||
| 300 | + R"""Like :func:`join_path`, but makes sure an OS native path is returned. | ||
| 301 | 301 | ||
| 302 | 302 | This is only needed to play it safe on Windows and to ensure nice paths that only | |
| 303 | 303 | use ``\``. | |
@@ -308,10 +308,12 @@ def join_path_native(a: PathLike, *p: PathLike) -> PathLike: | |||
| 308 | 308 | def assure_directory_exists(path: PathLike, is_file: bool = False) -> bool: | |
| 309 | 309 | """Make sure that the directory pointed to by path exists. | |
| 310 | 310 | ||
| 311 | - :param is_file: If True, ``path`` is assumed to be a file and handled correctly. | ||
| 311 | + :param is_file: | ||
| 312 | + If True, `path` is assumed to be a file and handled correctly. | ||
| 312 | 313 | Otherwise it must be a directory. | |
| 313 | 314 | ||
| 314 | - :return: True if the directory was created, False if it already existed. | ||
| 315 | + :return: | ||
| 316 | + True if the directory was created, False if it already existed. | ||
| 315 | 317 | """ | |
| 316 | 318 | if is_file: | |
| 317 | 319 | path = osp.dirname(path) | |
@@ -339,7 +341,8 @@ def py_where(program: str, path: Optional[PathLike] = None) -> List[str]: | |||
| 339 | 341 | :func:`is_cygwin_git`. When a search following all shell rules is needed, | |
| 340 | 342 | :func:`shutil.which` can be used instead. | |
| 341 | 343 | ||
| 342 | - :note: Neither this function nor :func:`shutil.which` will predict the effect of an | ||
| 344 | + :note: | ||
| 345 | + Neither this function nor :func:`shutil.which` will predict the effect of an | ||
| 343 | 346 | executable search on a native Windows system due to a :class:`subprocess.Popen` | |
| 344 | 347 | call without ``shell=True``, because shell and non-shell executable search on | |
| 345 | 348 | Windows differ considerably. | |
@@ -550,8 +553,7 @@ def remove_password_if_present(cmdline: Sequence[str]) -> List[str]: | |||
| 550 | 553 | class RemoteProgress: | |
| 551 | 554 | """Handler providing an interface to parse progress information emitted by | |
| 552 | 555 | ``git push`` and ``git fetch`` and to dispatch callbacks allowing subclasses to | |
| 553 | - react to the progress. | ||
| 554 | - """ | ||
| 556 | + react to the progress.""" | ||
| 555 | 557 | ||
| 556 | 558 | _num_op_codes: int = 9 | |
| 557 | 559 | ( | |
@@ -761,8 +763,8 @@ def update(self, *args: Any, **kwargs: Any) -> None: | |||
| 761 | 763 | ||
| 762 | 764 | class Actor: | |
| 763 | 765 | """Actors hold information about a person acting on the repository. They | |
| 764 | - can be committers and authors or anything with a name and an email as | ||
| 765 | - mentioned in the git log entries.""" | ||
| 766 | + can be committers and authors or anything with a name and an email as mentioned in | ||
| 767 | + the git log entries.""" | ||
| 766 | 768 | ||
| 767 | 769 | # PRECOMPILED REGEX | |
| 768 | 770 | name_only_regex = re.compile(r"<(.*)>") | |
@@ -802,7 +804,7 @@ def __repr__(self) -> str: | |||
| 802 | 804 | ||
| 803 | 805 | @classmethod | |
| 804 | 806 | def _from_string(cls, string: str) -> "Actor": | |
| 805 | - """Create an Actor from a string. | ||
| 807 | + """Create an :class:`Actor` from a string. | ||
| 806 | 808 | ||
| 807 | 809 | :param string: | |
| 808 | 810 | The string, which is expected to be in regular git format:: | |
@@ -868,10 +870,11 @@ def default_name() -> str: | |||
| 868 | 870 | @classmethod | |
| 869 | 871 | def committer(cls, config_reader: Union[None, "GitConfigParser", "SectionConstraint"] = None) -> "Actor": | |
| 870 | 872 | """ | |
| 871 | - :return: Actor instance corresponding to the configured committer. It behaves | ||
| 872 | - similar to the git implementation, such that the environment will override | ||
| 873 | - configuration values of `config_reader`. If no value is set at all, it will | ||
| 874 | - be generated. | ||
| 873 | + :return: | ||
| 874 | + :class:`Actor` instance corresponding to the configured committer. It | ||
| 875 | + behaves similar to the git implementation, such that the environment will | ||
| 876 | + override configuration values of `config_reader`. If no value is set at all, | ||
| 877 | + it will be generated. | ||
| 875 | 878 | ||
| 876 | 879 | :param config_reader: | |
| 877 | 880 | ConfigReader to use to retrieve the values from in case they are not set in | |
@@ -887,8 +890,7 @@ def author(cls, config_reader: Union[None, "GitConfigParser", "SectionConstraint | |||
| 887 | 890 | ||
| 888 | 891 | ||
| 889 | 892 | class Stats: | |
| 890 | - """ | ||
| 891 | - Represents stat information as presented by git at the end of a merge. It is | ||
| 893 | + """Represents stat information as presented by git at the end of a merge. It is | ||
| 892 | 894 | created from the output of a diff operation. | |
| 893 | 895 | ||
| 894 | 896 | Example:: | |
@@ -949,9 +951,9 @@ def _list_from_string(cls, repo: "Repo", text: str) -> "Stats": | |||
| 949 | 951 | ||
| 950 | 952 | ||
| 951 | 953 | class IndexFileSHA1Writer: | |
| 952 | - """Wrapper around a file-like object that remembers the SHA1 of | ||
| 953 | - the data written to it. It will write a sha when the stream is closed | ||
| 954 | - or if asked for explicitly using :meth:`write_sha`. | ||
| 954 | + """Wrapper around a file-like object that remembers the SHA1 of the data written to | ||
| 955 | + it. It will write a sha when the stream is closed or if asked for explicitly using | ||
| 956 | + :meth:`write_sha`. | ||
| 955 | 957 | ||
| 956 | 958 | Only useful to the index file. | |
| 957 | 959 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments