def __init__(self, args): self.args = args verify_has_connection_settings() server_url = get_server_url() verify_server_is_running() self.connection = Connection(server_url, token=get_token()) self.filemanager = FileManager(server_url)
def __init__(self, args=None): if args is None: args = self._get_args() self.args = args verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) self.connection = Connection(server_url, token=get_token())
def __init__(self, args, silent=False): self.args = args self.silent = silent verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) token = get_token() self.connection = Connection(server_url, token=token)
def __init__(self, args=None, silent=False): if args is None: args = self._get_args() self.args = args self.silent = silent verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) self.connection = Connection(server_url, token=get_token())
def __init__(self, args=None): # Parse arguments if args is None: args = _get_args() verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) self.args = args self._set_run_function() self.connection = Connection(server_url, token=None)
def __init__(self, args=None): # Args may be given as an input argument for testing purposes. # Otherwise get them from the parser. if args is None: args = self._get_args() self.args = args verify_has_connection_settings() self.server_url = get_server_url() verify_server_is_running(url=self.server_url)
def __init__(self, args): """Common init tasks for all Importer classes """ self.args = args verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) token = get_token() self.filemanager = FileManager(server_url, token=token) self.connection = Connection(server_url, token=token)
def __init__(self, args=None, silent=False): # Args may be given as an input argument for testing purposes. # Otherwise get them from the parser. if args is None: args = self._get_args() self.args = args self.silent = silent verify_has_connection_settings() self.server_url = get_server_url() verify_server_is_running(url=self.server_url)
def __init__(self, args=None, silent=False): # Parse arguments if args is None: args = _get_args() verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) self.args = args self.silent = silent self._set_run_function() self.connection = Connection(server_url, token=None)
def __call__(self, parser, namespace, values, option_string): if not has_connection_settings(): server_version = 'not connected' else: url = get_server_url() if not is_server_running(url=url): server_version = 'no response' else: connection = Connection(url) server_version = connection.get_version() print "client version: %s" % loomengine_utils.version.version() print "server version: %s" % server_version exit(0)
def __init__(self, args=None, silent=False): # Args may be given as an input argument for testing purposes. # Otherwise get them from the parser. if args is None: args = self._get_args() self.args = args self.silent = silent verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) token = get_token() self.connection = Connection(server_url, token=token) self.import_manager = ImportManager( connection=self.connection)
def __init__(self, args, silent=False): """Common init tasks for all File subcommands """ self.args = args self.silent = silent verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) token = get_token() self.connection = Connection(server_url, token=token) try: self.export_manager = ExportManager(connection=self.connection) self.import_manager = ImportManager(connection=self.connection) except LoomengineUtilsError as e: raise SystemExit("ERROR! Failed to initialize client: '%s'" % e)
def __init__(self, args=None, silent=False): self._validate_args(args) self.args = args self.silent = silent verify_has_connection_settings() server_url = get_server_url() verify_server_is_running(url=server_url) token = get_token() self.connection = Connection(server_url, token=token) try: self.storage_settings = self.connection.get_storage_settings() self.import_manager = ImportManager( self.connection, storage_settings=self.storage_settings) self.export_manager = ExportManager( self.connection, storage_settings=self.storage_settings) except LoomengineUtilsError as e: raise SystemExit("ERROR! Failed to initialize client: '%s'" % e)
def __call__(self, parser, namespace, values, option_string): if not has_connection_settings(): server_version = 'not connected' else: url = get_server_url() connection = Connection(url) try: server_version = connection.get_version() except ServerConnectionHttpError as e: server_version = '[server error! %s]' % e except ServerConnectionError: server_version = '[no response]' except LoomengineUtilsError as e: server_version = '[client error! %s]' % e print "client version: %s" % loomengine_utils.version.version() print "server version: %s" % server_version exit(0)