# Path: aeriscloud/config.py
# def module_path():
#     def __init__(self):
#     def load(self):
#     def has(self, section, option):
#     def get(self, section, option, **kwargs):
#     def set(self, section, option, value):
#     def unset(self, section, option):
#     def save(self):
#     def dump(self):
#     def complete(self):
# def inventory_path():
# def config_dir():
# def data_dir():
# def config_ini_path():
# def projects_path():
# def basebox_bucket():
# def default_organization():
# def expose_username():
# def expose_url():
# def has_github_integration():
# def verbosity(val=None):
# class Config(object):
# 
# Path: aeriscloud/ansible.py
# def get_env_path(organization):
#     return os.path.join(organization_path, organization)
# 
# Path: aeriscloud/project.py
# def get(name):
#     """
#     Return the project corresponding to the given project name or directory
# 
#     :param name: str
#     :return: Project|None
#     """
#     project_list = projects()
#     if name in project_list:
#         return project_list[name]
#     if os.path.isdir(os.path.join(projects_path(), name)):
#         return Project(os.path.join(projects_path(), name))
#     return None
# 
# def from_cwd():
#     path = os.getcwd()
#     pro_path = projects_path()
# 
#     # walk path upward until we find a .aeriscloud.yml file or until we
#     # reach the project folder
#     while True:
#         pro = from_path(path)
# 
#         if pro:
#             return pro
# 
#         if path == pro_path or not path.startswith(pro_path):
#             break
# 
#         path = os.path.dirname(path)
# 
#     return None


import os
import re
import sys
from aeriscloud.config import projects_path, aeriscloud_path,\
    data_dir, config_dir
from aeriscloud.ansible import get_env_path
from aeriscloud.project import get, from_cwd
        from aeriscloud.ansible import get_inventory_list
        from aeriscloud.ansible import inventory_path
        from aeriscloud.ansible import get_organization_list
        from aeriscloud.ansible import get_env_path, get_organization_list
        from aeriscloud.ansible import Inventory, get_inventory_file
        from aeriscloud.ansible import Inventory, get_inventory_file
        from slugify import slugify
    from aeriscloud.ansible import get_organization_list
    elif param == 'server':
        servers = ['production', 'aeris.cd', 'local']
        print(' '.join(servers))
    elif param == 'direction':
        directions = ['up', 'down']
        print(' '.join(directions))
    elif param == 'host':
        inventory = Inventory(get_inventory_file(project_name))
        hosts = inventory.get_hosts()
        print(' '.join([host.name for host in hosts]))
    elif param == 'limit':
        inventory = Inventory(get_inventory_file(project_name))
        hosts = inventory.get_hosts()
        groups = inventory.get_groups()
        print(' '.join([v.name for v in hosts + groups]))
    elif param == 'endpoint':
        if project_name:
            pro = get(project_name)
        else:
            pro = from_cwd()
        endpoints = [k for k, v in pro.endpoints().iteritems()]


        services = [slugify(service['name'])
                    for service in pro.box(box_name).services()]
        print(' '.join(endpoints + services))


def _print_path(name, extra=None):
    if name == 'aeriscloud':

# Path: aeriscloud/config.py
# def module_path():
#     def __init__(self):
#     def load(self):
#     def has(self, section, option):
#     def get(self, section, option, **kwargs):
#     def set(self, section, option, value):
#     def unset(self, section, option):
#     def save(self):
#     def dump(self):
#     def complete(self):
# def inventory_path():
# def config_dir():
# def data_dir():
# def config_ini_path():
# def projects_path():
# def basebox_bucket():
# def default_organization():
# def expose_username():
# def expose_url():
# def has_github_integration():
# def verbosity(val=None):
# class Config(object):
# 
# Path: aeriscloud/ansible.py
# def get_env_path(organization):
#     return os.path.join(organization_path, organization)
# 
# Path: aeriscloud/project.py
# def get(name):
#     """
#     Return the project corresponding to the given project name or directory
# 
#     :param name: str
#     :return: Project|None
#     """
#     project_list = projects()
#     if name in project_list:
#         return project_list[name]
#     if os.path.isdir(os.path.join(projects_path(), name)):
#         return Project(os.path.join(projects_path(), name))
#     return None
# 
# def from_cwd():
#     path = os.getcwd()
#     pro_path = projects_path()
# 
#     # walk path upward until we find a .aeriscloud.yml file or until we
#     # reach the project folder
#     while True:
#         pro = from_path(path)
# 
#         if pro:
#             return pro
# 
#         if path == pro_path or not path.startswith(pro_path):
#             break
# 
#         path = os.path.dirname(path)
# 
#     return None


# Path: aeriscloud/cli/complete.py
import os
import re
import sys
from aeriscloud.config import projects_path, aeriscloud_path,\
    data_dir, config_dir
from aeriscloud.ansible import get_env_path
from aeriscloud.project import get, from_cwd
        from aeriscloud.ansible import get_inventory_list
        from aeriscloud.ansible import inventory_path
        from aeriscloud.ansible import get_organization_list
        from aeriscloud.ansible import get_env_path, get_organization_list
        from aeriscloud.ansible import Inventory, get_inventory_file
        from aeriscloud.ansible import Inventory, get_inventory_file
        from slugify import slugify
    from aeriscloud.ansible import get_organization_list

    elif param == 'server':
        servers = ['production', 'aeris.cd', 'local']
        print(' '.join(servers))
    elif param == 'direction':
        directions = ['up', 'down']
        print(' '.join(directions))
    elif param == 'host':
        inventory = Inventory(get_inventory_file(project_name))
        hosts = inventory.get_hosts()
        print(' '.join([host.name for host in hosts]))
    elif param == 'limit':
        inventory = Inventory(get_inventory_file(project_name))
        hosts = inventory.get_hosts()
        groups = inventory.get_groups()
        print(' '.join([v.name for v in hosts + groups]))
    elif param == 'endpoint':
        if project_name:
            pro = get(project_name)
        else:
            pro = from_cwd()
        endpoints = [k for k, v in pro.endpoints().iteritems()]


        services = [slugify(service['name'])
                    for service in pro.box(box_name).services()]
        print(' '.join(endpoints + services))


def _print_path(name, extra=None):
    if name == 'aeriscloud':

        print(aeriscloud_path)