kopia lustrzana https://github.com/ihabunek/toot
Pass account as argument
rodzic
0e535a3fd0
commit
6a54f3dd0e
|
@ -212,14 +212,11 @@ class Help(urwid.Padding):
|
||||||
class Account(urwid.ListBox):
|
class Account(urwid.ListBox):
|
||||||
"""Shows account data and provides various actions"""
|
"""Shows account data and provides various actions"""
|
||||||
def __init__(self, account):
|
def __init__(self, account):
|
||||||
self.account = account
|
actions = list(self.generate_contents(account))
|
||||||
actions = list(self.generate_contents())
|
|
||||||
walker = urwid.SimpleListWalker(actions)
|
walker = urwid.SimpleListWalker(actions)
|
||||||
super().__init__(walker)
|
super().__init__(walker)
|
||||||
|
|
||||||
def generate_contents(self):
|
def generate_contents(self, account):
|
||||||
account = self.account
|
|
||||||
|
|
||||||
def link(text, url):
|
def link(text, url):
|
||||||
attr_map = {"link": "link_focused"}
|
attr_map = {"link": "link_focused"}
|
||||||
text = SelectableText([text, ("link", url)])
|
text = SelectableText([text, ("link", url)])
|
||||||
|
|
Ładowanie…
Reference in New Issue