Start rewrite

This commit is contained in:
2017-12-05 22:09:52 -08:00
parent 773e5d8914
commit af7d7338b0
50 changed files with 152 additions and 24438 deletions

0
ui/__init__.py Normal file
View File

32
ui/auth.py Normal file
View File

@@ -0,0 +1,32 @@
import urwid
class TokenEdit(urwid.Edit):
def __init__(self):
urwid.register_signal(TokenEdit, 'TokenEdit-changed')
prompt = ('seondary', u'Auth Token: ')
super(TokenEdit, self).__init__(prompt, '')
def keypress(self, size, key):
if key == 'enter':
urwid.emit_signal(self, 'TokenEdit-changed', self.edit_text)
else:
return super(TokenEdit, self).keypress(size, key)
class AuthPrompt(object):
def __init__(self, auth_url, callback):
self.callback = callback
token_input = TokenEdit()
urwid.connect_signal(token_input, 'TokenEdit-changed', self.callback)
self.frame = urwid.Filler(
urwid.Pile([
urwid.Text('Visit %s and paste the token below.\n' % auth_url),
token_input,
])
)
def callback(self, token):
self.callback(token)
def component(self):
return self.frame

11
ui/palette.py Normal file
View File

@@ -0,0 +1,11 @@
palette = [
('selected', 'standout', ''),
('selected workspace', 'standout,bold', ''),
('header', 'bold,light green', ''),
('secondary', 'light gray', ''),
('task', 'light green', ''),
('project', 'yellow', ''),
('section', 'white', 'dark green'),
('workspace', 'white', 'dark blue'),
('pager', 'standout', ''),
]