mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-18 21:09:41 +02:00
add border test
This commit is contained in:
parent
b5b721c466
commit
81ee6fca47
2 changed files with 54 additions and 3 deletions
|
@ -76,7 +76,6 @@ infected_files = None
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class scanThread(threading.Thread):
|
class scanThread(threading.Thread):
|
||||||
"""Scanning thread"""
|
"""Scanning thread"""
|
||||||
|
|
||||||
|
@ -866,12 +865,11 @@ def get_lock(process_name):
|
||||||
os.execvp("/usr/bin/bash", ["/usr/bin/bash", "--norc"])
|
os.execvp("/usr/bin/bash", ["/usr/bin/bash", "--norc"])
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def main(_):
|
def main(_):
|
||||||
"""Main entry point"""
|
"""Main entry point"""
|
||||||
|
print("main")
|
||||||
try:
|
try:
|
||||||
state = "START"
|
state = "START"
|
||||||
while state != "STOP":
|
while state != "STOP":
|
||||||
|
@ -885,5 +883,7 @@ def main(_):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
print("Start")
|
||||||
get_lock("pandora-box")
|
get_lock("pandora-box")
|
||||||
curses.wrapper(main)
|
curses.wrapper(main)
|
||||||
|
print("Done.")
|
||||||
|
|
51
tests/border.py
Executable file
51
tests/border.py
Executable file
|
@ -0,0 +1,51 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import curses
|
||||||
|
import locale
|
||||||
|
|
||||||
|
def main(stdscr):
|
||||||
|
# Initialiser les locales
|
||||||
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
|
||||||
|
# Clear screen
|
||||||
|
stdscr.clear()
|
||||||
|
|
||||||
|
# Dessiner une bordure avec les caractères ACS
|
||||||
|
stdscr.border(
|
||||||
|
curses.ACS_VLINE, curses.ACS_VLINE,
|
||||||
|
curses.ACS_HLINE, curses.ACS_HLINE,
|
||||||
|
curses.ACS_ULCORNER, curses.ACS_URCORNER,
|
||||||
|
curses.ACS_LLCORNER, curses.ACS_LRCORNER
|
||||||
|
)
|
||||||
|
|
||||||
|
# Rafraîchir l'écran pour afficher les modifications
|
||||||
|
stdscr.refresh()
|
||||||
|
|
||||||
|
# Attendre une touche pour sortir
|
||||||
|
stdscr.getkey()
|
||||||
|
|
||||||
|
curses.wrapper(main)
|
||||||
|
import curses
|
||||||
|
import locale
|
||||||
|
|
||||||
|
def main(stdscr):
|
||||||
|
# Initialiser les locales
|
||||||
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
|
||||||
|
# Clear screen
|
||||||
|
stdscr.clear()
|
||||||
|
|
||||||
|
# Dessiner une bordure avec les caractères ACS
|
||||||
|
stdscr.border(
|
||||||
|
curses.ACS_VLINE, curses.ACS_VLINE,
|
||||||
|
curses.ACS_HLINE, curses.ACS_HLINE,
|
||||||
|
curses.ACS_ULCORNER, curses.ACS_URCORNER,
|
||||||
|
curses.ACS_LLCORNER, curses.ACS_LRCORNER
|
||||||
|
)
|
||||||
|
|
||||||
|
# Rafraîchir l'écran pour afficher les modifications
|
||||||
|
stdscr.refresh()
|
||||||
|
|
||||||
|
# Attendre une touche pour sortir
|
||||||
|
stdscr.getkey()
|
||||||
|
|
||||||
|
curses.wrapper(main)
|
Loading…
Add table
Add a link
Reference in a new issue