| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8d3efc5 commit a5fc1d8
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -979,7 +979,7 @@ def execute( | |||
| 979 | 979 | else: | |
| 980 | 980 | cmd_not_found_exception = FileNotFoundError # NOQA # exists, flake8 unknown @UndefinedVariable | |
| 981 | 981 | maybe_patch_caller_env = contextlib.nullcontext() | |
| 982 | - # end handle | ||
| 982 | + # END handle | ||
| 983 | 983 | ||
| 984 | 984 | stdout_sink = PIPE if with_stdout else getattr(subprocess, "DEVNULL", None) or open(os.devnull, "wb") | |
| 985 | 985 | if shell is None: | |
@@ -1048,7 +1048,7 @@ def kill_process(pid: int) -> None: | |||
| 1048 | 1048 | pass | |
| 1049 | 1049 | return | |
| 1050 | 1050 | ||
| 1051 | - # end | ||
| 1051 | + # END def kill_process | ||
| 1052 | 1052 | ||
| 1053 | 1053 | if kill_after_timeout is not None: | |
| 1054 | 1054 | kill_check = threading.Event() | |
@@ -1100,7 +1100,7 @@ def kill_process(pid: int) -> None: | |||
| 1100 | 1100 | def as_text(stdout_value: Union[bytes, str]) -> str: | |
| 1101 | 1101 | return not output_stream and safe_decode(stdout_value) or "<OUTPUT_STREAM>" | |
| 1102 | 1102 | ||
| 1103 | - # end | ||
| 1103 | + # END def as_text | ||
| 1104 | 1104 | ||
| 1105 | 1105 | if stderr_value: | |
| 1106 | 1106 | log.info( | |
@@ -1304,9 +1304,9 @@ def _call_process( | |||
| 1304 | 1304 | "Couldn't find argument '%s' in args %s to insert cmd options after" | |
| 1305 | 1305 | % (insert_after_this_arg, str(ext_args)) | |
| 1306 | 1306 | ) from err | |
| 1307 | - # end handle error | ||
| 1307 | + # END handle error | ||
| 1308 | 1308 | args_list = ext_args[: index + 1] + opt_args + ext_args[index + 1 :] | |
| 1309 | - # end handle opts_kwargs | ||
| 1309 | + # END handle opts_kwargs | ||
| 1310 | 1310 | ||
| 1311 | 1311 | call = [self.GIT_PYTHON_GIT_EXECUTABLE] | |
| 1312 | 1312 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -446,12 +446,11 @@ def _read(self, fp: Union[BufferedReader, IO[bytes]], fpname: str) -> None: | |||
| 446 | 446 | def string_decode(v: str) -> str: | |
| 447 | 447 | if v[-1] == "\\": | |
| 448 | 448 | v = v[:-1] | |
| 449 | - # end cut trailing escapes to prevent decode error | ||
| 449 | + # END cut trailing escapes to prevent decode error | ||
| 450 | 450 | ||
| 451 | 451 | return v.encode(defenc).decode("unicode_escape") | |
| 452 | - # end | ||
| 453 | 452 | ||
| 454 | - # end | ||
| 453 | + # END def string_decode | ||
| 455 | 454 | ||
| 456 | 455 | while True: | |
| 457 | 456 | # We assume to read binary! | |
@@ -496,12 +495,12 @@ def string_decode(v: str) -> str: | |||
| 496 | 495 | optval = optval.strip() | |
| 497 | 496 | if optval == '""': | |
| 498 | 497 | optval = "" | |
| 499 | - # end handle empty string | ||
| 498 | + # END handle empty string | ||
| 500 | 499 | optname = self.optionxform(optname.rstrip()) | |
| 501 | 500 | if len(optval) > 1 and optval[0] == '"' and optval[-1] != '"': | |
| 502 | 501 | is_multi_line = True | |
| 503 | 502 | optval = string_decode(optval[1:]) | |
| 504 | - # end handle multi-line | ||
| 503 | + # END handle multi-line | ||
| 505 | 504 | # Preserves multiple values for duplicate optnames. | |
| 506 | 505 | cursect.add(optname, optval) | |
| 507 | 506 | else: | |
@@ -516,7 +515,7 @@ def string_decode(v: str) -> str: | |||
| 516 | 515 | if line.endswith('"'): | |
| 517 | 516 | is_multi_line = False | |
| 518 | 517 | line = line[:-1] | |
| 519 | - # end handle quotations | ||
| 518 | + # END handle quotations | ||
| 520 | 519 | optval = cursect.getlast(optname) | |
| 521 | 520 | cursect.setlast(optname, optval + string_decode(line)) | |
| 522 | 521 | # END parse section or option | |
@@ -600,7 +599,7 @@ def read(self) -> None: # type: ignore[override] | |||
| 600 | 599 | files_to_read = [self._file_or_files] | |
| 601 | 600 | else: # for lists or tuples | |
| 602 | 601 | files_to_read = list(self._file_or_files) | |
| 603 | - # end ensure we have a copy of the paths to handle | ||
| 602 | + # END ensure we have a copy of the paths to handle | ||
| 604 | 603 | ||
| 605 | 604 | seen = set(files_to_read) | |
| 606 | 605 | num_read_include_files = 0 | |
@@ -631,27 +630,26 @@ def read(self) -> None: # type: ignore[override] | |||
| 631 | 630 | if not osp.isabs(include_path): | |
| 632 | 631 | if not file_ok: | |
| 633 | 632 | continue | |
| 634 | - # end ignore relative paths if we don't know the configuration file path | ||
| 633 | + # END ignore relative paths if we don't know the configuration file path | ||
| 635 | 634 | file_path = cast(PathLike, file_path) | |
| 636 | 635 | assert osp.isabs(file_path), "Need absolute paths to be sure our cycle checks will work" | |
| 637 | 636 | include_path = osp.join(osp.dirname(file_path), include_path) | |
| 638 | - # end make include path absolute | ||
| 637 | + # END make include path absolute | ||
| 639 | 638 | include_path = osp.normpath(include_path) | |
| 640 | 639 | if include_path in seen or not os.access(include_path, os.R_OK): | |
| 641 | 640 | continue | |
| 642 | 641 | seen.add(include_path) | |
| 643 | 642 | # Insert included file to the top to be considered first. | |
| 644 | 643 | files_to_read.insert(0, include_path) | |
| 645 | 644 | num_read_include_files += 1 | |
| 646 | - # each include path in configuration file | ||
| 647 | - # end handle includes | ||
| 645 | + # END each include path in configuration file | ||
| 646 | + # END handle includes | ||
| 648 | 647 | # END for each file object to read | |
| 649 | 648 | ||
| 650 | 649 | # If there was no file included, we can safely write back (potentially) the | |
| 651 | 650 | # configuration file without altering its meaning. | |
| 652 | 651 | if num_read_include_files == 0: | |
| 653 | 652 | self._merge_includes = False | |
| 654 | - # end | ||
| 655 | 653 | ||
| 656 | 654 | def _write(self, fp: IO) -> None: | |
| 657 | 655 | """Write an .ini-format representation of the configuration state in | |
@@ -714,15 +712,15 @@ def write(self) -> None: | |||
| 714 | 712 | "Cannot write back if there is not exactly a single file to write to, have %i files" | |
| 715 | 713 | % len(self._file_or_files) | |
| 716 | 714 | ) | |
| 717 | - # end assert multiple files | ||
| 715 | + # END assert multiple files | ||
| 718 | 716 | ||
| 719 | 717 | if self._has_includes(): | |
| 720 | 718 | log.debug( | |
| 721 | 719 | "Skipping write-back of configuration file as include files were merged in." | |
| 722 | 720 | + "Set merge_includes=False to prevent this." | |
| 723 | 721 | ) | |
| 724 | 722 | return None | |
| 725 | - # end | ||
| 723 | + # END stop if we have include files | ||
| 726 | 724 | ||
| 727 | 725 | fp = self._file_or_files | |
| 728 | 726 | ||
@@ -904,7 +902,7 @@ def rename_section(self, section: str, new_name: str) -> "GitConfigParser": | |||
| 904 | 902 | new_section = self._sections[new_name] | |
| 905 | 903 | for k, vs in self.items_all(section): | |
| 906 | 904 | new_section.setall(k, vs) | |
| 907 | - # end for each value to copy | ||
| 905 | + # END for each value to copy | ||
| 908 | 906 | ||
| 909 | 907 | # This call writes back the changes, which is why we don't have the respective decorator. | |
| 910 | 908 | self.remove_section(section) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -442,7 +442,7 @@ def __str__(self) -> str: | |||
| 442 | 442 | msg += self.diff.decode(defenc) if isinstance(self.diff, bytes) else self.diff | |
| 443 | 443 | except UnicodeDecodeError: | |
| 444 | 444 | msg += "OMITTED BINARY DATA" | |
| 445 | - # end handle encoding | ||
| 445 | + # END handle encoding | ||
| 446 | 446 | msg += "\n---" | |
| 447 | 447 | # END diff info | |
| 448 | 448 | ||
@@ -543,7 +543,7 @@ def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoIn | |||
| 543 | 543 | # and then retro-actively assign it to our index. | |
| 544 | 544 | if previous_header is not None: | |
| 545 | 545 | index[-1].diff = text[previous_header.end() : _header.start()] | |
| 546 | - # end assign actual diff | ||
| 546 | + # END assign actual diff | ||
| 547 | 547 | ||
| 548 | 548 | # Make sure the mode is set if the path is set. Otherwise the resulting blob is invalid. | |
| 549 | 549 | # We just use the one mode we should have parsed. | |
@@ -571,10 +571,10 @@ def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoIn | |||
| 571 | 571 | ||
| 572 | 572 | previous_header = _header | |
| 573 | 573 | header = _header | |
| 574 | - # end for each header we parse | ||
| 574 | + # END for each header we parse | ||
| 575 | 575 | if index and header: | |
| 576 | 576 | index[-1].diff = text[header.end() :] | |
| 577 | - # end assign last diff | ||
| 577 | + # END assign last diff | ||
| 578 | 578 | ||
| 579 | 579 | return index | |
| 580 | 580 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -406,7 +406,7 @@ def raise_exc(e: Exception) -> NoReturn: | |||
| 406 | 406 | if S_ISLNK(st.st_mode): | |
| 407 | 407 | yield abs_path.replace(rs, "") | |
| 408 | 408 | continue | |
| 409 | - # end check symlink | ||
| 409 | + # END check symlink | ||
| 410 | 410 | ||
| 411 | 411 | # If the path is not already pointing to an existing file, resolve globs if possible. | |
| 412 | 412 | if not os.path.exists(abs_path) and ("?" in abs_path or "*" in abs_path or "[" in abs_path): | |
@@ -689,7 +689,7 @@ def _entries_for_paths( | |||
| 689 | 689 | gitrelative_path = path | |
| 690 | 690 | if self.repo.working_tree_dir: | |
| 691 | 691 | abspath = osp.join(self.repo.working_tree_dir, gitrelative_path) | |
| 692 | - # end obtain relative and absolute paths | ||
| 692 | + # END obtain relative and absolute paths | ||
| 693 | 693 | ||
| 694 | 694 | blob = Blob( | |
| 695 | 695 | self.repo, | |
@@ -867,7 +867,7 @@ def handle_null_entries(self: "IndexFile") -> None: | |||
| 867 | 867 | ) | |
| 868 | 868 | # END for each entry index | |
| 869 | 869 | ||
| 870 | - # end closure | ||
| 870 | + # END closure | ||
| 871 | 871 | handle_null_entries(self) | |
| 872 | 872 | # END null_entry handling | |
| 873 | 873 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -123,7 +123,7 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None: | |||
| 123 | 123 | stdout = force_text(stdout, defenc) | |
| 124 | 124 | stderr = force_text(stderr, defenc) | |
| 125 | 125 | raise HookExecutionError(hp, process.returncode, stderr, stdout) | |
| 126 | - # end handle return code | ||
| 126 | + # END handle return code | ||
| 127 | 127 | ||
| 128 | 128 | ||
| 129 | 129 | def stat_mode_to_index_mode(mode: int) -> int: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -553,7 +553,7 @@ def create_from_tree( | |||
| 553 | 553 | for p in parent_commits: | |
| 554 | 554 | if not isinstance(p, cls): | |
| 555 | 555 | raise ValueError(f"Parent commit '{p!r}' must be of type {cls}") | |
| 556 | - # end check parent commit types | ||
| 556 | + # END check parent commit types | ||
| 557 | 557 | # END if parent commits are unset | |
| 558 | 558 | ||
| 559 | 559 | # Retrieve all additional information, create a commit object, and serialize it. | |
@@ -730,7 +730,7 @@ def _deserialize(self, stream: BytesIO) -> "Commit": | |||
| 730 | 730 | next_line = readline() | |
| 731 | 731 | while next_line.startswith(b" "): | |
| 732 | 732 | next_line = readline() | |
| 733 | - # end skip mergetags | ||
| 733 | + # END skip mergetags | ||
| 734 | 734 | ||
| 735 | 735 | # Now we can have the encoding line, or an empty line followed by the optional message. | |
| 736 | 736 | self.encoding = self.default_encoding | |
@@ -754,7 +754,7 @@ def _deserialize(self, stream: BytesIO) -> "Commit": | |||
| 754 | 754 | is_next_header = True | |
| 755 | 755 | break | |
| 756 | 756 | sig += sigbuf[1:] | |
| 757 | - # end read all signature | ||
| 757 | + # END read all signature | ||
| 758 | 758 | self.gpgsig = sig.rstrip(b"\n").decode(self.encoding, "ignore") | |
| 759 | 759 | if is_next_header: | |
| 760 | 760 | continue | |
| Back | FazBrowse Home | New Git URL |
0 commit comments