How to use the spython.main.get_client function in spython

To help you get started, we’ve selected a few spython examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github singularityhub / singularity-cli / spython / client / shell.py View on Github external
def prepare_client(image):
    '''prepare a client to embed in a shell with recipe parsers and writers.
    '''
    # The client will announce itself (backend/database) unless it's get
    from spython.main import get_client
    from spython.main.parse import parsers
    from spython.main.parse import writers

    client = get_client()
    client.load(image)

    # Add recipe parsers
    client.parsers = parsers
    client.writers = writers
    return client
github singularityhub / singularity-compose / scompose / project / instance.py View on Github external
def __init__(self, name, working_dir, sudo=False, params=None):

        if not params:
            params = {}

        self.image = None
        self.recipe = None
        self.instance = None
        self.sudo = sudo
        self.set_name(name, params)
        self.set_args(params)
        self.set_context(params)
        self.set_volumes(params)
        self.set_ports(params)
        self.params = params
        self.client = get_client()
        self.working_dir = working_dir

        # If the instance exists, instantiate it
        self.get()
github singularityhub / singularity-compose / scompose / project / project.py View on Github external
def __init__(self, filename=None, name=None, env_file=None):

        self.set_filename(filename)
        self.set_name(name)
        self.load()
        self.parse()
        self.env_file = env_file
        self.client = get_client()