Browse Source

Curses

pull/111/head
Jure Šorn 3 years ago
parent
commit
7af8bec7c3
2 changed files with 6 additions and 6 deletions
  1. 4
      README.md
  2. 8
      index.html

4
README.md

@ -2383,8 +2383,8 @@ def main(screen):
while ch != ascii.ESC:
height, _ = screen.getmaxyx()
screen.clear()
for y, a_path in enumerate(paths[first : first+height]):
screen.addstr(y, 0, a_path, A_REVERSE * (selected == first + y))
for y, filename in enumerate(paths[first : first+height]):
screen.addstr(y, 0, filename, A_REVERSE * (selected == first + y))
ch = screen.getch()
selected += (ch == KEY_DOWN) - (ch == KEY_UP)
selected = max(0, min(len(paths)-1, selected))

8
index.html

@ -226,7 +226,7 @@ pre.prettyprint {
<body>
<header>
<aside>October 1, 2021</aside>
<aside>October 2, 2021</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -2093,8 +2093,8 @@ plt.clf() <span class="hljs-comment"># Clea
<span class="hljs-keyword">while</span> ch != ascii.ESC:
height, _ = screen.getmaxyx()
screen.clear()
<span class="hljs-keyword">for</span> y, a_path <span class="hljs-keyword">in</span> enumerate(paths[first : first+height]):
screen.addstr(y, <span class="hljs-number">0</span>, a_path, A_REVERSE * (selected == first + y))
<span class="hljs-keyword">for</span> y, filename <span class="hljs-keyword">in</span> enumerate(paths[first : first+height]):
screen.addstr(y, <span class="hljs-number">0</span>, filename, A_REVERSE * (selected == first + y))
ch = screen.getch()
selected += (ch == KEY_DOWN) - (ch == KEY_UP)
selected = max(<span class="hljs-number">0</span>, min(len(paths)<span class="hljs-number">-1</span>, selected))
@ -3005,7 +3005,7 @@ $ pyinstaller script.py --add-data '&lt;path&gt;:.' <span class="hljs-comment">
<footer>
<aside>October 1, 2021</aside>
<aside>October 2, 2021</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

Loading…
Cancel
Save