def load_user_config(): global personal_client, business_client, user_conf global account_store, drive_store user_conf = get_current_user_config() user_conf.take_effect() network_monitor.start() personal_client = clients.PersonalClient(proxies=user_conf.proxies, net_monitor=network_monitor) business_client = None account_store = account_db.AccountStorage(CONFIG_DIR + '/accounts.db', personal_client=personal_client, business_client=business_client) drive_store = drives_db.DriveStorage(CONFIG_DIR + '/drives.db', account_store) account_store.get_all_accounts()
import sys from clint.textui import colored, columns, indent, prompt, puts, validators from onedrive_d import OS_USER_NAME, OS_USER_HOME, mkdir from onedrive_d.api import accounts, clients from onedrive_d.cli import CONFIG_DIR, get_current_user_config from onedrive_d.common import drive_config, netman from onedrive_d.store import account_db, drives_db from onedrive_d.vendor.utils import pretty_print_bytes try: if not os.path.exists(CONFIG_DIR): mkdir(CONFIG_DIR) print(colored.green('Created path "' + CONFIG_DIR + '".')) user_conf = get_current_user_config() network_monitor = netman.NetworkMonitor() personal_client = clients.PersonalClient(proxies=user_conf.proxies, net_monitor=network_monitor) business_client = None account_store = account_db.AccountStorage( CONFIG_DIR + '/accounts.db', personal_client=personal_client, business_client=business_client) drive_store = drives_db.DriveStorage(CONFIG_DIR + '/drives.db', account_store) except Exception as e: print(colored.red('Fatal error: ' + str(e))) sys.exit(1) def add_personal_account(): puts(colored.green('Link with an OneDrive Personal account:')) puts(colored.cyan( 'Please use your browser to visit the following URL, sign in with your OneDrive account and '
import sys from clint.textui import colored, columns, indent, prompt, puts, validators from onedrive_d import OS_USER_NAME, OS_USER_HOME, mkdir from onedrive_d.api import accounts, clients from onedrive_d.cli import CONFIG_DIR, get_current_user_config from onedrive_d.common import drive_config, netman from onedrive_d.store import account_db, drives_db from onedrive_d.vendor.utils import pretty_print_bytes try: if not os.path.exists(CONFIG_DIR): mkdir(CONFIG_DIR) print(colored.green('Created path "' + CONFIG_DIR + '".')) user_conf = get_current_user_config() network_monitor = netman.NetworkMonitor() personal_client = clients.PersonalClient(proxies=user_conf.proxies, net_monitor=network_monitor) business_client = None account_store = account_db.AccountStorage(CONFIG_DIR + '/accounts.db', personal_client=personal_client, business_client=business_client) drive_store = drives_db.DriveStorage(CONFIG_DIR + '/drives.db', account_store) except Exception as e: print(colored.red('Fatal error: ' + str(e))) sys.exit(1) def add_personal_account():