Coding style.
This commit is contained in:
parent
a9b579e7d6
commit
1560db5f82
4 changed files with 7 additions and 4 deletions
3
fill3.py
3
fill3.py
|
|
@ -466,6 +466,7 @@ def main(loop, appearance_changed_event, screen_widget, exit_loop=None):
|
||||||
loop.add_signal_handler(signal.SIGTERM, exit_loop)
|
loop.add_signal_handler(signal.SIGTERM, exit_loop)
|
||||||
asyncio.ensure_future(_update_screen(screen_widget,
|
asyncio.ensure_future(_update_screen(screen_widget,
|
||||||
appearance_changed_event))
|
appearance_changed_event))
|
||||||
with terminal.hidden_cursor(), terminal.fullscreen(), _urwid_screen() as urwid_screen:
|
with terminal.hidden_cursor(), terminal.fullscreen(), \
|
||||||
|
_urwid_screen() as urwid_screen:
|
||||||
loop.add_reader(sys.stdin, on_input, urwid_screen, screen_widget)
|
loop.add_reader(sys.stdin, on_input, urwid_screen, screen_widget)
|
||||||
loop.run_forever()
|
loop.run_forever()
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,8 @@ class Color:
|
||||||
class CharStyle:
|
class CharStyle:
|
||||||
|
|
||||||
_POOL = weakref.WeakValueDictionary()
|
_POOL = weakref.WeakValueDictionary()
|
||||||
_TERMINAL256_FORMATTER = pygments.formatters.terminal256.Terminal256Formatter()
|
_TERMINAL256_FORMATTER = \
|
||||||
|
pygments.formatters.terminal256.Terminal256Formatter()
|
||||||
|
|
||||||
def __new__(cls, fg_color=None, bg_color=None, is_bold=False,
|
def __new__(cls, fg_color=None, bg_color=None, is_bold=False,
|
||||||
is_italic=False, is_underlined=False):
|
is_italic=False, is_underlined=False):
|
||||||
|
|
|
||||||
2
tools.py
2
tools.py
|
|
@ -690,7 +690,7 @@ def pil_half(path):
|
||||||
rows = _pil_pixels(image)
|
rows = _pil_pixels(image)
|
||||||
if image.height % 2 == 1:
|
if image.height % 2 == 1:
|
||||||
rows.append([None] * image.width)
|
rows.append([None] * image.width)
|
||||||
result = fill3.Fixed([
|
result = fill3.Fixed([
|
||||||
termstr.TermStr(text, tuple(termstr.CharStyle(
|
termstr.TermStr(text, tuple(termstr.CharStyle(
|
||||||
fg_color=top_pixel, bg_color=bottom_pixel)
|
fg_color=top_pixel, bg_color=bottom_pixel)
|
||||||
for top_pixel, bottom_pixel in zip(rows[index], rows[index+1])))
|
for top_pixel, bottom_pixel in zip(rows[index], rows[index+1])))
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,8 @@ class ToolsTestCase(unittest.TestCase):
|
||||||
self._test_tool(tools.cpp_syntax_gcc, [("hello.cpp", tools.Status.ok)])
|
self._test_tool(tools.cpp_syntax_gcc, [("hello.cpp", tools.Status.ok)])
|
||||||
|
|
||||||
def test_cpp_syntax_clang(self):
|
def test_cpp_syntax_clang(self):
|
||||||
self._test_tool(tools.cpp_syntax_clang, [("hello.cpp", tools.Status.ok)])
|
self._test_tool(tools.cpp_syntax_clang,
|
||||||
|
[("hello.cpp", tools.Status.ok)])
|
||||||
|
|
||||||
def test_bcpp(self):
|
def test_bcpp(self):
|
||||||
self._test_tool(tools.bcpp, [("hello.cpp", tools.Status.normal)])
|
self._test_tool(tools.bcpp, [("hello.cpp", tools.Status.normal)])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue