* "ClientDir\Info" renamed to "ClientDir\Logs"
* Logs are sorted into subdirs based on the source:
* KIT_NAME_FULL: WizardKit logs
* d7II: d7II logs
* Tools: Logs from tools called by WizardKit or d7II
* (no subdir): System information
* "ClientDir\Backups"
* Switched to "Backups\Source\{Date}" from "Backups\{Date}\Source"
54 lines
1.4 KiB
Python
54 lines
1.4 KiB
Python
# Wizard Kit: Reset Browsers
|
|
|
|
import os
|
|
import sys
|
|
|
|
# Init
|
|
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
|
sys.path.append(os.getcwd())
|
|
from functions.browsers import *
|
|
from functions.cleanup import *
|
|
from functions.setup import *
|
|
init_global_vars()
|
|
os.system('title {}: Browser Reset Tool'.format(KIT_NAME_FULL))
|
|
global_vars['LogFile'] = r'{LogDir}\{kit_name}\Browser Reset ({USERNAME}).log'.format(
|
|
kit_name=KIT_NAME_FULL, **global_vars, **global_vars['Env'])
|
|
D7_MODE = 'd7mode' in sys.argv
|
|
|
|
if __name__ == '__main__':
|
|
try:
|
|
stay_awake()
|
|
clear_screen()
|
|
print_info('{}: Browser Reset\n'.format(KIT_NAME_FULL))
|
|
other_results = {
|
|
'Warning': {
|
|
'NotInstalledError': 'Not installed',
|
|
'NoProfilesError': 'No profiles found',
|
|
}}
|
|
|
|
# Bail early
|
|
if not D7_MODE and not ask('Reset browsers to safe defaults first?'):
|
|
exit_script()
|
|
|
|
# Scan for supported browsers
|
|
print_info('Scanning for browsers')
|
|
scan_for_browsers()
|
|
|
|
# Homepages
|
|
print_info('Current homepages')
|
|
list_homepages()
|
|
|
|
# Backup
|
|
print_info('Backing up browsers')
|
|
backup_browsers()
|
|
|
|
# Reset
|
|
print_info('Resetting browsers')
|
|
reset_browsers()
|
|
|
|
# Done
|
|
exit_script()
|
|
except SystemExit:
|
|
pass
|
|
except:
|
|
major_exception()
|