def cli(debug, username, password, servername, url, token, config, verify_ssl, default_folder): """ Entry point for the CLI.""" global PMS global CONFIG # Remember to update the subcommands in __init__ if sub commands are added. # Default folder is handled in fake_main as we need to modify # the variables before import plex.py, its just listed here for the help # message etc. if config and os.path.isfile(config): CONFIG = read_or_make(config) url = url or CONFIG['server'].get('url') token = token or CONFIG['server'].get('token') verify_ssl = verify_ssl or CONFIG['server'].get('verify_ssl') if url and token or username and password: PMS = get_pms(url=url, token=token, username=username, password=password, servername=servername, verify_ssl=verify_ssl)
def cli(debug, username, password, servername, url, token, config, verify_ssl): """ Entry point for the CLI.""" global PMS global CONFIG if debug: LOG.setLevel(logging.DEBUG) else: LOG.setLevel(logging.INFO) if config and os.path.isfile(config): CONFIG = read_or_make(config) url = url or CONFIG.get('url') token = token or CONFIG.get('token') verify_ssl = verify_ssl or CONFIG.get('verify_ssl') if url and token or username and password: PMS = get_pms(url=url, token=token, username=username, password=password, servername=servername, verify_ssl=verify_ssl)