Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87a6ffa

Browse files
committed
Fix flake8
1 parent763ef75 commit87a6ffa

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

‎git/cmd.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
## @{
4747

4848
defhandle_process_output(process,stdout_handler,stderr_handler,finalizer):
49-
"""Registers for notifications to lean that process output is ready to read, and dispatches lines to
50-
the respective line handlers. We are able to handle carriage returns in case progress is sent by that
49+
"""Registers for notifications to lean that process output is ready to read, and dispatches lines to
50+
the respective line handlers. We are able to handle carriage returns in case progress is sent by that
5151
mean. For performance reasons, we only apply this to stderr.
5252
This function returns once the finalizer returns
5353
:return: result of finalizer
@@ -77,7 +77,7 @@ def read_line_slow(stream):
7777
defdispatch_line(fno):
7878
stream,handler,readline=fdmap[fno]
7979
# this can possibly block for a while, but since we wake-up with at least one or more lines to handle,
80-
# we are good ...
80+
# we are good ...
8181
line=readline(stream).decode(defenc)
8282
iflineandhandler:
8383
handler(line)
@@ -93,13 +93,13 @@ def deplete_buffer(fno, wg=None):
9393
# end deplete buffer
9494
ifwg:
9595
wg.done()
96-
# end
96+
# end
9797

98-
fdmap= {process.stdout.fileno(): (process.stdout,stdout_handler,read_line_fast),
99-
process.stderr.fileno(): (process.stderr,stderr_handler,read_line_slow)}
98+
fdmap= {process.stdout.fileno(): (process.stdout,stdout_handler,read_line_fast),
99+
process.stderr.fileno(): (process.stderr,stderr_handler,read_line_slow)}
100100

101101
ifhasattr(select,'poll'):
102-
# poll is preferred, as select is limited to file handles up to 1024 ... . This could otherwise be
102+
# poll is preferred, as select is limited to file handles up to 1024 ... . This could otherwise be
103103
# an issue for us, as it matters how many handles or own process has
104104
poll=select.poll()
105105
READ_ONLY=select.POLLIN|select.POLLPRI|select.POLLHUP|select.POLLERR
@@ -137,18 +137,18 @@ def deplete_buffer(fno, wg=None):
137137
wg=WaitGroup()
138138
forfnoinfdmap.keys():
139139
wg.add(1)
140-
t=threading.Thread(target=lambda:deplete_buffer(fno,wg))
140+
t=threading.Thread(target=lambda:deplete_buffer(fno,wg))
141141
t.start()
142142
# end
143-
# NOTE: Just joining threads can possibly fail as there is a gap between .start() and when it's
143+
# NOTE: Just joining threads can possibly fail as there is a gap between .start() and when it's
144144
# actually started, which could make the wait() call to just return because the thread is not yet
145145
# active
146146
wg.wait()
147147
# end
148148

149149
returnfinalizer(process)
150150

151-
151+
152152
defdashify(string):
153153
returnstring.replace('_','-')
154154

‎git/remote.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
#{ Utilities
4242

43+
4344
defadd_progress(kwargs,git,progress):
4445
"""Add the --progress flag to the given kwargs dict if supported by the
4546
git command. If the actual progress in the given progress instance is not
@@ -510,6 +511,7 @@ def _get_fetch_info_from_stderr(self, proc, progress):
510511
cmds=set(PushInfo._flag_map.keys())&set(FetchInfo._flag_map.keys())
511512

512513
progress_handler=progress.new_message_handler()
514+
513515
defmy_progress_handler(line):
514516
forplineinprogress_handler(line):
515517
ifline.startswith('fatal:'):
@@ -520,11 +522,11 @@ def my_progress_handler(line):
520522
fetch_info_lines.append(line)
521523
continue
522524
# end find command code
523-
# end for each comand code we know
525+
# end for each comand code we know
524526
# end for each line progress didn't handle
525527
# end
526528

527-
# We are only interested in stderr here ...
529+
# We are only interested in stderr here ...
528530
handle_process_output(proc,None,my_progress_handler,finalize_process)
529531

530532
# read head information

‎git/util.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def _parse_progress_line(self, line):
251251
returnfailed_lines
252252

253253
defnew_message_handler(self):
254-
""":return: a progress handler suitable for handle_process_output(), passing lines on to this Progress
254+
""":return: a progress handler suitable for handle_process_output(), passing lines on to this Progress
255255
handler in a suitable format"""
256256
defhandler(line):
257257
returnself._parse_progress_line(line.rstrip())
@@ -704,26 +704,26 @@ def iter_items(cls, repo, *args, **kwargs):
704704

705705
classWaitGroup(object):
706706
"""WaitGroup is like Go sync.WaitGroup.
707-
707+
708708
Without all the useful corner cases.
709709
By Peter Teichman, taken from https://gist.github.com/pteichman/84b92ae7cef0ab98f5a8
710710
"""
711711
def__init__(self):
712712
self.count=0
713713
self.cv=threading.Condition()
714-
714+
715715
defadd(self,n):
716716
self.cv.acquire()
717717
self.count+=n
718718
self.cv.release()
719-
719+
720720
defdone(self):
721721
self.cv.acquire()
722722
self.count-=1
723723
ifself.count==0:
724724
self.cv.notify_all()
725725
self.cv.release()
726-
726+
727727
defwait(self):
728728
self.cv.acquire()
729729
whileself.count>0:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp