feat: Initial commit
This commit is contained in:
commit
934055205e
12 changed files with 37 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.venv/
|
||||
0
LICENSE
Normal file
0
LICENSE
Normal file
1
README.md
Normal file
1
README.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
# PyExp
|
||||
0
docs/.gitkeep
Normal file
0
docs/.gitkeep
Normal file
0
requirements.txt
Normal file
0
requirements.txt
Normal file
0
src/__init__.py
Normal file
0
src/__init__.py
Normal file
0
src/items/AItems.py
Normal file
0
src/items/AItems.py
Normal file
0
src/items/File.py
Normal file
0
src/items/File.py
Normal file
0
src/items/Folder.py
Normal file
0
src/items/Folder.py
Normal file
0
src/items/Symlink.py
Normal file
0
src/items/Symlink.py
Normal file
0
src/items/__init__.py
Normal file
0
src/items/__init__.py
Normal file
35
src/main.py
Normal file
35
src/main.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import curses
|
||||
from curses import wrapper
|
||||
|
||||
|
||||
def init_curse() -> None:
|
||||
curses.curs_set(0)
|
||||
curses.start_color()
|
||||
curses.use_default_colors()
|
||||
|
||||
curses.init_pair(1, curses.COLOR_YELLOW, -1) # fg, bg
|
||||
curses.init_pair(2, curses.COLOR_CYAN, -1)
|
||||
curses.init_pair(3, curses.COLOR_GREEN, -1)
|
||||
|
||||
|
||||
def print_folder(stdscr: curses.window, path: str) -> None:
|
||||
stdscr.clear()
|
||||
|
||||
stdscr.attron(curses.color_pair(1))
|
||||
stdscr.addstr(0, 1, path)
|
||||
stdscr.attroff(curses.color_pair(1))
|
||||
|
||||
for i in range(1, 9):
|
||||
stdscr.attron(curses.color_pair(2))
|
||||
stdscr.addstr(i, 0, " f - a")
|
||||
stdscr.attroff(curses.color_pair(2))
|
||||
|
||||
|
||||
def main(stdscr):
|
||||
init_curse()
|
||||
print_folder(stdscr, "/tmp")
|
||||
stdscr.refresh()
|
||||
stdscr.getkey()
|
||||
|
||||
|
||||
wrapper(main)
|
||||
Loading…
Add table
Reference in a new issue