Connection to atomic structures on the Catalysis-Hub
       server with ase db cli.
       Arguments to the the ase db cli client must be enclosed in one string.
       For example: <cathub ase 'formula=Ag6In6H -s energy -L 200'>.
       To see possible ase db arguments run <ase db --help>

def ase(dbuser, dbpassword, args, gui):
    """Connection to atomic structures on the Catalysis-Hub
       server with ase db cli.
       Arguments to the the ase db cli client must be enclosed in one string.
       For example: <cathub ase 'formula=Ag6In6H -s energy -L 200'>.
       To see possible ase db arguments run <ase db --help>"""
    if dbuser == 'upload':
        dbpassword = 'cHyuuQH0'
    db = CathubPostgreSQL(user=dbuser, password=dbpassword)
    db._connect()
    server_name = db.server_name
    subprocess.call(
        ("ase db {} {}".format(server_name, args)).split())
    if gui:
        args = args.split('-')[0]
        subprocess.call(
            ('ase gui {}@{}'.format(server_name, args)).split())