mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-20 10:26:44 +01:00
Updated to delete line
This commit is contained in:
parent
729f57c9c8
commit
06e686f81b
1 changed files with 7 additions and 4 deletions
|
@ -1,15 +1,16 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
from multiprocessing import Process
|
||||
|
||||
from slpkg.configs import Configs
|
||||
from slpkg.utilities import Utilities
|
||||
from slpkg.error_messages import Errors
|
||||
from slpkg.views.asciibox import AsciiBox
|
||||
from slpkg.progress_bar import ProgressBar
|
||||
from slpkg.error_messages import Errors
|
||||
|
||||
|
||||
class MultiProcess(Configs):
|
||||
|
@ -22,6 +23,7 @@ class MultiProcess(Configs):
|
|||
self.ascii = AsciiBox()
|
||||
self.errors = Errors()
|
||||
|
||||
self.columns, self.rows = shutil.get_terminal_size()
|
||||
self.timestamp: str = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
self.head_message: str = f'Timestamp: {self.timestamp}'
|
||||
self.bottom_message: str = 'EOF - End of log file'
|
||||
|
@ -67,12 +69,13 @@ class MultiProcess(Configs):
|
|||
# Terminate process 2 if process 1 finished
|
||||
if not process_1.is_alive():
|
||||
process_2.terminate()
|
||||
print(f"\r{' ' * (self.columns - 1)}", end='') # Delete previous line.
|
||||
if process_1.exitcode != 0:
|
||||
print(f"\r{'':>2}{self.bred}{self.ascii.bullet}{self.endc} {filename} {failed}{' ' * 17}", end='')
|
||||
print(f"\r{'':>2}{self.bred}{self.ascii.bullet}{self.endc} {filename} {failed}", end='')
|
||||
elif installed:
|
||||
print(f"\r{'':>2}{self.bred}{self.ascii.bullet}{self.endc} {filename} {skip}{' ' * 17}", end='')
|
||||
print(f"\r{'':>2}{self.bred}{self.ascii.bullet}{self.endc} {filename} {skip}", end='')
|
||||
else:
|
||||
print(f"\r{'':>2}{self.bgreen}{self.ascii.bullet}{self.endc} {filename} {done}{' ' * 17}", end='')
|
||||
print(f"\r{'':>2}{self.bgreen}{self.ascii.bullet}{self.endc} {filename} {done}", end='')
|
||||
|
||||
# Restore the terminal cursor
|
||||
print('\x1b[?25h', self.endc)
|
||||
|
|
Loading…
Reference in a new issue