-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filtering result format changed. Highlight merging added.
- Loading branch information
1 parent
d0b29ff
commit dbd7444
Showing
5 changed files
with
596 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import urwid | ||
from projects.filter import Filter | ||
|
||
ll = [ | ||
'projects', | ||
'matlab-library-system', | ||
'intervallum', | ||
'skillmath', | ||
'optimal-position', | ||
'site', | ||
'something', | ||
'regular-army-knife' | ||
] | ||
|
||
f = Filter(ll) | ||
|
||
|
||
def generate_string(data): | ||
ret = [] | ||
for item in data: | ||
|
||
for | ||
ret.append(item['string']+'\n') | ||
return ret | ||
|
||
|
||
def exit_on_q(key): | ||
key = key.lower() | ||
if key in ('delete', 'backspace'): | ||
f.remove_key() | ||
else: | ||
f.add_key(key) | ||
fl = f.filter() | ||
s = generate_string(fl) | ||
txt.set_text(s) | ||
if key in ('esc',): | ||
raise urwid.ExitMainLoop() | ||
|
||
palette = [ | ||
('text', 'light gray', 'black'), | ||
('highlight', 'black', 'yellow'), | ||
('bg', 'black', 'dark blue')] | ||
|
||
txt = urwid.Text([('text', u"Hello World\n"), ('highlight', "Hello")], align='left') | ||
map1 = urwid.AttrMap(txt, 'streak') | ||
fill = urwid.Filler(map1) | ||
pad = urwid.Padding(fill, align='center', width=30) | ||
loop = urwid.MainLoop(pad, palette, unhandled_input=exit_on_q) | ||
loop.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.