diff options
author | David Pursehouse <dpursehouse@collab.net> | 2020-02-12 15:20:19 +0900 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2020-02-12 06:36:40 +0000 |
commit | 819827a42ddb364f98c3a1a7eae2536dc54bc4cc (patch) | |
tree | fe6bdca5ff7e44d53595a6da76d2b56ea659eee1 /pager.py | |
parent | abdf7500612f1d115863ba8f026ddbea1e5a1f28 (diff) | |
download | git-repo-819827a42ddb364f98c3a1a7eae2536dc54bc4cc.tar.gz |
Fix blank line issues reported by flake8
- E301 expected 1 blank line
- E302 expected 2 blank lines
- E303 too many blank lines
- E305 expected 2 blank lines after class or function definition
- E306 expected 1 blank line before a nested definition
Fixed automatically with autopep8:
git ls-files | grep py$ | xargs autopep8 --in-place \
--select E301,E302,E303,E305,E306
Manually fix issues in project.py caused by misuse of block comments.
Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'pager.py')
-rw-r--r-- | pager.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -27,6 +27,7 @@ pager_process = None | |||
27 | old_stdout = None | 27 | old_stdout = None |
28 | old_stderr = None | 28 | old_stderr = None |
29 | 29 | ||
30 | |||
30 | def RunPager(globalConfig): | 31 | def RunPager(globalConfig): |
31 | if not os.isatty(0) or not os.isatty(1): | 32 | if not os.isatty(0) or not os.isatty(1): |
32 | return | 33 | return |
@@ -39,6 +40,7 @@ def RunPager(globalConfig): | |||
39 | else: | 40 | else: |
40 | _ForkPager(pager) | 41 | _ForkPager(pager) |
41 | 42 | ||
43 | |||
42 | def TerminatePager(): | 44 | def TerminatePager(): |
43 | global pager_process, old_stdout, old_stderr | 45 | global pager_process, old_stdout, old_stderr |
44 | if pager_process: | 46 | if pager_process: |
@@ -52,6 +54,7 @@ def TerminatePager(): | |||
52 | sys.stdout = old_stdout | 54 | sys.stdout = old_stdout |
53 | sys.stderr = old_stderr | 55 | sys.stderr = old_stderr |
54 | 56 | ||
57 | |||
55 | def _PipePager(pager): | 58 | def _PipePager(pager): |
56 | global pager_process, old_stdout, old_stderr | 59 | global pager_process, old_stdout, old_stderr |
57 | assert pager_process is None, "Only one active pager process at a time" | 60 | assert pager_process is None, "Only one active pager process at a time" |
@@ -62,6 +65,7 @@ def _PipePager(pager): | |||
62 | sys.stdout = pager_process.stdin | 65 | sys.stdout = pager_process.stdin |
63 | sys.stderr = pager_process.stdin | 66 | sys.stderr = pager_process.stdin |
64 | 67 | ||
68 | |||
65 | def _ForkPager(pager): | 69 | def _ForkPager(pager): |
66 | global active | 70 | global active |
67 | # This process turns into the pager; a child it forks will | 71 | # This process turns into the pager; a child it forks will |
@@ -88,6 +92,7 @@ def _ForkPager(pager): | |||
88 | print("fatal: cannot start pager '%s'" % pager, file=sys.stderr) | 92 | print("fatal: cannot start pager '%s'" % pager, file=sys.stderr) |
89 | sys.exit(255) | 93 | sys.exit(255) |
90 | 94 | ||
95 | |||
91 | def _SelectPager(globalConfig): | 96 | def _SelectPager(globalConfig): |
92 | try: | 97 | try: |
93 | return os.environ['GIT_PAGER'] | 98 | return os.environ['GIT_PAGER'] |
@@ -105,6 +110,7 @@ def _SelectPager(globalConfig): | |||
105 | 110 | ||
106 | return 'less' | 111 | return 'less' |
107 | 112 | ||
113 | |||
108 | def _BecomePager(pager): | 114 | def _BecomePager(pager): |
109 | # Delaying execution of the pager until we have output | 115 | # Delaying execution of the pager until we have output |
110 | # ready works around a long-standing bug in popularly | 116 | # ready works around a long-standing bug in popularly |