Added clear_screen()

This commit is contained in:
Alan Mason 2017-11-30 14:08:12 -08:00
parent 5eaefb3e41
commit 11cf75d4a6
16 changed files with 21 additions and 17 deletions

View file

@ -13,7 +13,7 @@ os.system('title {}: Windows Activation Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: Windows Activation Tool\n'.format(KIT_NAME_FULL))
# Bail early if already activated
if windows_is_activated():

View file

@ -16,7 +16,7 @@ if __name__ == '__main__':
try:
# Prep
stay_awake()
os.system('cls')
clear_screen()
folder_path = r'{}\Backups'.format(KIT_NAME_SHORT)
dest = select_destination(folder_path=folder_path,
prompt='Which disk are we using for temp data and backup?')

View file

@ -14,7 +14,7 @@ global_vars['LogFile'] = r'{LogDir}\Check Disk.log'.format(**global_vars)
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
other_results = {
'Error': {
'CalledProcessError': 'Unknown Error',

View file

@ -14,7 +14,7 @@ global_vars['LogFile'] = r'{LogDir}\DISM helper tool.log'.format(**global_vars)
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
other_results = {
'Error': {
'CalledProcessError': 'Unknown Error',

View file

@ -81,6 +81,10 @@ def ask(prompt='Kotaero!'):
print_log(message=message)
return answer
def clear_screen():
"""Simple wrapper for cls."""
os.system('cls')
def convert_to_bytes(size):
"""Convert human-readable size str to bytes and return an int."""
size = str(size)
@ -259,7 +263,7 @@ def menu_select(title='~ Untitled Menu ~',
answer = ''
while (answer.upper() not in valid_answers):
os.system('cls')
clear_screen()
print(menu_splash)
answer = input('{}: '.format(prompt))

View file

@ -14,7 +14,7 @@ global_vars['LogFile'] = r'{LogDir}\Install SW Bundle.log'.format(**global_vars)
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: SW Bundle Tool\n'.format(KIT_NAME_FULL))
other_results = {
'Error': {

View file

@ -14,7 +14,7 @@ global_vars['LogFile'] = r'{LogDir}\Install Visual C++ Runtimes.log'.format(**gl
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: Install Visual C++ Runtimes\n'.format(KIT_NAME_FULL))
other_results = {
'Error': {

View file

@ -15,7 +15,7 @@ os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__':
try:
os.system('cls')
clear_screen()
print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL))
if not ask('Enable booting to SafeMode (with Networking)?'):
abort()

View file

@ -15,7 +15,7 @@ os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__':
try:
os.system('cls')
clear_screen()
print_info('{}: SafeMode Tool\n'.format(KIT_NAME_FULL))
if not ask('Disable booting to SafeMode?'):
abort()

View file

@ -14,7 +14,7 @@ global_vars['LogFile'] = r'{LogDir}\SFC Tool.log'.format(**global_vars)
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: SFC Tool\n'.format(KIT_NAME_FULL))
other_results = {
'Error': {

View file

@ -18,7 +18,7 @@ global_vars['LogFile'] = r'{LogDir}\System Checklist.log'.format(**global_vars)
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: System Checklist Tool\n'.format(KIT_NAME_FULL))
ticket_number = get_ticket_number()
other_results = {

View file

@ -19,7 +19,7 @@ global_vars['LogFile'] = r'{LogDir}\System Diagnostics.log'.format(
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: System Diagnostics Tool\n'.format(KIT_NAME_FULL))
ticket_number = get_ticket_number()
other_results = {

View file

@ -14,7 +14,7 @@ global_vars['LogFile'] = r'{LogDir}\Transferred Keys.log'.format(**global_vars)
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: Transferred Key Finder\n'.format(KIT_NAME_FULL))
try_and_print(message='Searching for keys...',
function=list_clientdir_keys, print_return=True)

View file

@ -12,7 +12,7 @@ os.system('title {}: Kit Update Tool'.format(KIT_NAME_FULL))
if __name__ == '__main__':
try:
os.system('cls')
clear_screen()
print_info('{}: Kit Update Tool\n'.format(KIT_NAME_FULL))
other_results = {
'Error': {

View file

@ -17,7 +17,7 @@ global_vars['LogFile'] = r'{LogDir}\User Checklist ({USERNAME}).log'.format(
if __name__ == '__main__':
try:
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: User Checklist\n'.format(KIT_NAME_FULL))
other_results = {
'Warning': {

View file

@ -16,7 +16,7 @@ if __name__ == '__main__':
try:
# Prep
stay_awake()
os.system('cls')
clear_screen()
print_info('{}: User Data Transfer Tool\n'.format(KIT_NAME_FULL))
ticket_number = get_ticket_number()
folder_path = r'{}\Transfer'.format(KIT_NAME_SHORT)
@ -26,7 +26,7 @@ if __name__ == '__main__':
items = scan_source(source, dest)
# Transfer
os.system('cls')
clear_screen()
print_info('Transfer Details:\n')
show_info('Ticket:', ticket_number)
show_info('Source:', source.path)