New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring: remove dead code from Raw display #707
Conversation
@@ -212,90 +213,6 @@ def _stop(self): | |||
|
|||
super()._stop() | |||
|
|||
@typing.overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate from base class
b |= mod | ||
result.extend([27, ord("["), ord("M"), b + 32, x + 32, y + 32]) | ||
|
||
def determine_button_release(flag: int) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used and unreachable from outside
signals.connect_signal(self, UPDATE_PALETTE_ENTRY, self._on_update_palette_entry) | ||
self.colors: Literal[1, 16, 88, 256, 16777216] = 16 # FIXME: detect this | ||
self.has_underline = True # FIXME: detect this | ||
self._keyqueue = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used across whole project
if not partial_display(): | ||
return escape.set_cursor_position(0, 0) | ||
return escape.CURSOR_HOME_COL + escape.move_cursor_up(cy) | ||
|
||
def set_cursor_row(y): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used and unreachable from outside
@@ -1153,7 +1153,7 @@ def register_palette_entry( | |||
mono = ",".join(mono) | |||
if mono is None: | |||
mono = DEFAULT | |||
mono = AttrSpec(mono, DEFAULT, 1) | |||
mono_spec = AttrSpec(mono, DEFAULT, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not replace variable and not confuse static analysis
Pull Request Test Coverage Report for Build 7209892230
💛 - Coveralls |
@@ -108,7 +108,6 @@ def __init__(self): | |||
self.has_color = False | |||
self.s = None | |||
self.cursor_state = None | |||
self._keyqueue = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used across whole project
@@ -29,7 +29,7 @@ | |||
SAFE_ASCII_RE = re.compile("^[ -~]*$") | |||
SAFE_ASCII_BYTES_RE = re.compile(b"^[ -~]*$") | |||
|
|||
_byte_encoding = None | |||
_byte_encoding: Literal["utf8", "narrow", "wide"] = "narrow" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use correct default value with minimal functionality
f4ade73
to
2f84f69
Compare
pass | ||
|
||
@abc.abstractmethod | ||
def draw_screen(self, size: tuple[int, int], r: Canvas) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method is ultimately used by MainLoop - require to implement
* CursesDisplay: stop using private namespace `_curses` for exceptions * Mass add typing for better static logic trace
2f84f69
to
99aca4b
Compare
urwid/display_common.py
Outdated
|
||
Default (fallback) is 80x24. | ||
""" | ||
return 24, 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring says columns, rows but return value suggests rows, columns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original code removed above returned 80, 24
_curses
for exceptionsChecklist
master
orpython-dual-support
branchtox
successfully in local environment