mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-05-03 14:45:07 -04:00
Ban urwid==2.4.3
as containing UI regression.
Fix urwid entities init: use correct `super()`, hack `__super` is officially deprecated. Method <Class>.method(self, ...) is only for fallback in corner cases (normally not recommended to use).
This commit is contained in:
parent
d856f3fd28
commit
ed6ba63317
7 changed files with 31 additions and 31 deletions
|
@ -608,7 +608,7 @@ class LinkSpec(urwid.AttrSpec):
|
|||
self.link_target = link_target
|
||||
self.link_fields = None
|
||||
|
||||
urwid.AttrSpec.__init__(self, orig_spec.foreground, orig_spec.background)
|
||||
super().__init__(orig_spec.foreground, orig_spec.background)
|
||||
|
||||
|
||||
class LinkableText(urwid.Text):
|
||||
|
@ -618,7 +618,7 @@ class LinkableText(urwid.Text):
|
|||
signals = ["click", "change"]
|
||||
|
||||
def __init__(self, text, align=None, cursor_position=0, delegate=None):
|
||||
self.__super.__init__(text, align=align)
|
||||
super().__init__(text, align=align)
|
||||
self.delegate = delegate
|
||||
self._cursor_position = 0
|
||||
self.key_timeout = 3
|
||||
|
@ -729,7 +729,7 @@ class LinkableText(urwid.Text):
|
|||
|
||||
def render(self, size, focus=False):
|
||||
now = time.time()
|
||||
c = self.__super.render(size, focus)
|
||||
c = super().render(size, focus)
|
||||
|
||||
if focus and (self.delegate == None or now < self.delegate.last_keypress+self.key_timeout):
|
||||
c = urwid.CompositeCanvas(c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue