pep8
This commit is contained in:
parent
cdd943ded4
commit
5e48ae8bac
@ -326,7 +326,7 @@ def write_remote_control_protocol_docs() -> None: # {{{
|
|||||||
p(' ', desc), p()
|
p(' ', desc), p()
|
||||||
p(), p()
|
p(), p()
|
||||||
|
|
||||||
with open(f'generated/rc.rst', 'w') as f:
|
with open('generated/rc.rst', 'w') as f:
|
||||||
p = partial(print, file=f)
|
p = partial(print, file=f)
|
||||||
for name in sorted(all_command_names()):
|
for name in sorted(all_command_names()):
|
||||||
cmd = command_for_name(name)
|
cmd = command_for_name(name)
|
||||||
|
|||||||
@ -287,7 +287,7 @@ def category_test(
|
|||||||
p('\tswitch(code) {')
|
p('\tswitch(code) {')
|
||||||
for spec in get_ranges(list(chars)):
|
for spec in get_ranges(list(chars)):
|
||||||
write_case(spec, p)
|
write_case(spec, p)
|
||||||
p(f'\t\t\treturn true;')
|
p('\t\t\treturn true;')
|
||||||
p('\t} // }}}\n')
|
p('\t} // }}}\n')
|
||||||
p('\treturn false;\n}\n')
|
p('\treturn false;\n}\n')
|
||||||
|
|
||||||
@ -421,8 +421,8 @@ def gen_names() -> None:
|
|||||||
p('}; // }}}\n')
|
p('}; // }}}\n')
|
||||||
|
|
||||||
# The trie
|
# The trie
|
||||||
p(f'typedef struct {{ uint32_t children_offset; uint32_t match_offset; }} word_trie;\n')
|
p('typedef struct {{ uint32_t children_offset; uint32_t match_offset; }} word_trie;\n')
|
||||||
all_trie_nodes: List['TrieNode'] = []
|
all_trie_nodes: List['TrieNode'] = [] # noqa
|
||||||
|
|
||||||
class TrieNode:
|
class TrieNode:
|
||||||
|
|
||||||
|
|||||||
@ -289,9 +289,9 @@ class PrintHelpForSeq:
|
|||||||
leading_indent = indent
|
leading_indent = indent
|
||||||
j = '\n' + (' ' * indent)
|
j = '\n' + (' ' * indent)
|
||||||
lines: List[str] = []
|
lines: List[str] = []
|
||||||
for l in text.splitlines():
|
for ln in text.splitlines():
|
||||||
if l:
|
if ln:
|
||||||
lines.extend(wrap(l, limit=linesz - indent))
|
lines.extend(wrap(ln, limit=linesz - indent))
|
||||||
else:
|
else:
|
||||||
lines.append('')
|
lines.append('')
|
||||||
a((' ' * leading_indent) + j.join(lines))
|
a((' ' * leading_indent) + j.join(lines))
|
||||||
|
|||||||
@ -60,8 +60,8 @@ def screen_cursor_to_column(c: int) -> None:
|
|||||||
write(CSI + '%dG' % c)
|
write(CSI + '%dG' % c)
|
||||||
|
|
||||||
|
|
||||||
def screen_cursor_to_line(l: int) -> None:
|
def screen_cursor_to_line(ln: int) -> None:
|
||||||
write(CSI + '%dd' % l)
|
write(CSI + '%dd' % ln)
|
||||||
|
|
||||||
|
|
||||||
def screen_set_mode(x: int, private: bool) -> None:
|
def screen_set_mode(x: int, private: bool) -> None:
|
||||||
|
|||||||
@ -624,7 +624,7 @@ class Window:
|
|||||||
lines = self.screen.text_for_selection()
|
lines = self.screen.text_for_selection()
|
||||||
if self.opts.strip_trailing_spaces == 'always' or (
|
if self.opts.strip_trailing_spaces == 'always' or (
|
||||||
self.opts.strip_trailing_spaces == 'smart' and not self.screen.is_rectangle_select()):
|
self.opts.strip_trailing_spaces == 'smart' and not self.screen.is_rectangle_select()):
|
||||||
return ''.join((l.rstrip() or '\n') for l in lines)
|
return ''.join((ln.rstrip() or '\n') for ln in lines)
|
||||||
return ''.join(lines)
|
return ''.join(lines)
|
||||||
|
|
||||||
def call_watchers(self, which: Iterable[Watcher], data: Dict[str, Any]) -> None:
|
def call_watchers(self, which: Iterable[Watcher], data: Dict[str, Any]) -> None:
|
||||||
|
|||||||
@ -333,10 +333,10 @@ class TestScreen(BaseTest):
|
|||||||
s.cursor_position(region + 1, 1), nl()
|
s.cursor_position(region + 1, 1), nl()
|
||||||
s.cursor_position(region, 1), s.draw(ch)
|
s.cursor_position(region, 1), s.draw(ch)
|
||||||
s.cursor_position(region, s.columns), s.draw(ch.lower())
|
s.cursor_position(region, s.columns), s.draw(ch.lower())
|
||||||
for l in range(2, region + 2):
|
for ln in range(2, region + 2):
|
||||||
c = chr(ord('I') + l - 2)
|
c = chr(ord('I') + ln - 2)
|
||||||
before = '\t' if l % 4 == 0 else ' '
|
before = '\t' if ln % 4 == 0 else ' '
|
||||||
self.ae(c + ' ' * (s.columns - 3) + before + c.lower(), str(s.line(l)))
|
self.ae(c + ' ' * (s.columns - 3) + before + c.lower(), str(s.line(ln)))
|
||||||
s.reset_mode(DECOM)
|
s.reset_mode(DECOM)
|
||||||
# Test that moving cursor outside the margins works as expected
|
# Test that moving cursor outside the margins works as expected
|
||||||
s = self.create_screen(10, 10)
|
s = self.create_screen(10, 10)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user