Skip to content

Commit 012ea90

Browse files
committed
Apply black
1 parent 214e4ca commit 012ea90

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def __init__(self, watcher, old_meta_path):
279279

280280
def find_distributions(self, context):
281281
for finder in self.old_meta_path:
282-
distribution_finder = getattr(finder, 'find_distributions', None)
282+
distribution_finder = getattr(finder, "find_distributions", None)
283283
if distribution_finder is not None:
284284
loader = finder.find_distributions(context)
285285
if loader is not None:
@@ -404,7 +404,7 @@ def __init__(
404404
# this is every line that's been executed; it gets smaller on rewind
405405
self.history = []
406406

407-
# This is every logical line that's been displayed, both input and output.
407+
# This is every logical line that's been displayed, both input and output.
408408
# Like self.history, lines are unwrapped, uncolored, and without prompt.
409409
# Entries are tuples, where
410410
# - the first element the line (string, not fmtsr)
@@ -1602,12 +1602,12 @@ def move_screen_up(current_line_start_row):
16021602
len(self.current_line),
16031603
self.cursor_offset,
16041604
)
1605-
else: # Common case for determining cursor position
1605+
else: # Common case for determining cursor position
16061606
cursor_row, cursor_column = divmod(
16071607
(
16081608
wcswidth(self.current_cursor_line_without_suggestion.s)
16091609
- wcswidth(self.current_line)
1610-
+ wcswidth(self.current_line[: self.cursor_offset])
1610+
+ wcswidth(self.current_line[: self.cursor_offset])
16111611
),
16121612
width,
16131613
)
@@ -1832,7 +1832,7 @@ def take_back_empty_line(self):
18321832
self.history.pop()
18331833
self.display_lines.pop()
18341834
self.all_logical_lines.pop()
1835-
1835+
18361836
def prompt_undo(self):
18371837
if self.buffer:
18381838
return self.take_back_buffer_line()
@@ -1847,7 +1847,7 @@ def prompt_for_undo():
18471847
greenlet.greenlet(prompt_for_undo).switch()
18481848

18491849
def redo(self):
1850-
if (self.redo_stack):
1850+
if self.redo_stack:
18511851
temp = self.redo_stack.pop()
18521852
self.history.append(temp)
18531853
self.all_logical_lines.append((temp, LineType.INPUT))

bpython/repl.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,15 @@ def file_prompt(self, s):
388388
class SourceNotFound(Exception):
389389
"""Exception raised when the requested source could not be found."""
390390

391+
391392
class LineTypeTranslator(Enum):
392393
""" Used when adding a tuple to all_logical_lines, to get input / output values
393394
having to actually type/know the strings """
395+
394396
INPUT = "input"
395397
OUTPUT = "output"
396398

399+
397400
class Repl(object):
398401
"""Implements the necessary guff for a Python-repl-alike interface
399402
@@ -833,6 +836,7 @@ def process():
833836
elif line.rstrip():
834837
yield "# OUT: %s" % line
835838
yield "###: %s" % self.current_line
839+
836840
return "\n".join(process())
837841

838842
def write2file(self):
@@ -1014,7 +1018,7 @@ def undo(self, n=1):
10141018

10151019
entries = list(self.rl_history.entries)
10161020

1017-
#Most recently undone command
1021+
# Most recently undone command
10181022
last_entries = self.history[-n:]
10191023
last_entries.reverse()
10201024
self.redo_stack += last_entries

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def initialize_options(self):
228228
"curtsies >=0.1.18",
229229
"greenlet",
230230
"six >=1.5",
231-
"wcwidth"
231+
"wcwidth",
232232
]
233233

234234
extras_require = {

0 commit comments

Comments
 (0)