1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-19 05:19:40 +02:00

add border test

This commit is contained in:
Didier 2024-06-30 11:26:19 +02:00
parent b5b721c466
commit 81ee6fca47
2 changed files with 54 additions and 3 deletions

View file

@ -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
View 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)