# Path: aeriscloud/cli/helpers.py
# def standard_options(multiple=False, start_prompt=True):
#     """
#     Add the standard --project and --box options to a command
#     :param multiple: Whether to find a single or multiple boxes
#     :param start_prompt: When using single boxes, ask the user to start it if
#                          offline
#     """
#     if multiple:
#         return _multi_box_decorator
#     else:
#         return _single_box_decorator(start_prompt)
# 
# class Command(click.Command):
#     # This is inherited by the Context to switch between pure POSIX and
#     # argparse-like argument parsing. Setting it to false will push any
#     # unknown flag to the argument located where the flag was declared
#     allow_interspersed_args = config.get('config', 'posix', default=False)
# 
#     def __init__(self, *args, **kwargs):
#         cs = dict(help_option_names=['-h', '--help'])
#         super(Command, self).__init__(context_settings=cs,
#                                       *args, **kwargs)
# 
# class CLITable(object):
#     """
#     Helps displaying a dynamically sized table a la docker ps
#     """
#     COL_PADDING = 2
# 
#     def __init__(self, *cols):
#         self._cols = cols
#         self._header_out = False
# 
#     def _str(self, data, size):
#         str_real_len = len(strip_ansi(data))
#         return data + (' ' * (size - str_real_len))
# 
#     def _compute_col_sizes(self, data):
#         sizes = {}
#         # prepend data with header
#         data = [dict(zip(self._cols, self._cols))] + data
#         for row in data:
#             for name, row_data in row.iteritems():
#                 real_len = len(strip_ansi(row_data))
#                 if name not in sizes or real_len > sizes[name]:
#                     sizes[name] = real_len
#         # filter unknown values
#         self._sizes = dict([
#             (key, length + self.COL_PADDING)
#             for key, length in sizes.iteritems()
#             if key in self._cols
#         ])
# 
#     def _header(self):
#         if self._header_out:
#             return
# 
#         self._header_out = True
#         for name in self._cols:
#             click.echo(self._str(name.upper(), self._sizes[name]), nl=False)
#         click.echo('')
# 
#     def echo(self, data):
#         if not isinstance(data, list):
#             data = [data]
# 
#         self._compute_col_sizes(data)
#         self._header()
# 
#         for row in data:
#             for name in self._cols:
#                 row_data = ''
#                 if name in row:
#                     row_data = row[name]
#                 click.echo(self._str(row_data, self._sizes[name]), nl=False)
#             click.echo('')


import click
from aeriscloud.cli.helpers import standard_options, Command, CLITable
#!/usr/bin/env python



status_table = CLITable('project', 'name', 'image', 'status')


def _status_sort(status):
    return '%s-%s' % (status['project'], status['name'])



# Path: aeriscloud/cli/helpers.py
# def standard_options(multiple=False, start_prompt=True):
#     """
#     Add the standard --project and --box options to a command
#     :param multiple: Whether to find a single or multiple boxes
#     :param start_prompt: When using single boxes, ask the user to start it if
#                          offline
#     """
#     if multiple:
#         return _multi_box_decorator
#     else:
#         return _single_box_decorator(start_prompt)
# 
# class Command(click.Command):
#     # This is inherited by the Context to switch between pure POSIX and
#     # argparse-like argument parsing. Setting it to false will push any
#     # unknown flag to the argument located where the flag was declared
#     allow_interspersed_args = config.get('config', 'posix', default=False)
# 
#     def __init__(self, *args, **kwargs):
#         cs = dict(help_option_names=['-h', '--help'])
#         super(Command, self).__init__(context_settings=cs,
#                                       *args, **kwargs)
# 
# class CLITable(object):
#     """
#     Helps displaying a dynamically sized table a la docker ps
#     """
#     COL_PADDING = 2
# 
#     def __init__(self, *cols):
#         self._cols = cols
#         self._header_out = False
# 
#     def _str(self, data, size):
#         str_real_len = len(strip_ansi(data))
#         return data + (' ' * (size - str_real_len))
# 
#     def _compute_col_sizes(self, data):
#         sizes = {}
#         # prepend data with header
#         data = [dict(zip(self._cols, self._cols))] + data
#         for row in data:
#             for name, row_data in row.iteritems():
#                 real_len = len(strip_ansi(row_data))
#                 if name not in sizes or real_len > sizes[name]:
#                     sizes[name] = real_len
#         # filter unknown values
#         self._sizes = dict([
#             (key, length + self.COL_PADDING)
#             for key, length in sizes.iteritems()
#             if key in self._cols
#         ])
# 
#     def _header(self):
#         if self._header_out:
#             return
# 
#         self._header_out = True
#         for name in self._cols:
#             click.echo(self._str(name.upper(), self._sizes[name]), nl=False)
#         click.echo('')
# 
#     def echo(self, data):
#         if not isinstance(data, list):
#             data = [data]
# 
#         self._compute_col_sizes(data)
#         self._header()
# 
#         for row in data:
#             for name in self._cols:
#                 row_data = ''
#                 if name in row:
#                     row_data = row[name]
#                 click.echo(self._str(row_data, self._sizes[name]), nl=False)
#             click.echo('')


# Path: aeriscloud/cli/aeris/status.py
import click
from aeriscloud.cli.helpers import standard_options, Command, CLITable

#!/usr/bin/env python



status_table = CLITable('project', 'name', 'image', 'status')


def _status_sort(status):
    return '%s-%s' % (status['project'], status['name'])



@click.command(cls=Command)