# Path: flask_table/table.py
# def create_table(name=str('_Table'), base=Table, options=None):
#     """Creates and returns a new table class. You can specify a name for
#     you class if you wish. You can also set the base class (or
#     classes) that should be used when creating the class.
# 
#     """
#     try:
#         base = tuple(base)
#     except TypeError:
#         # Then assume that what we have is a single class, so make it
#         # into a 1-tuple.
#         base = (base,)
# 
#     return TableMeta(name, base, options or {})
# 
# Path: flask_table/columns.py
# class Col(object):
#     """The subclass for all Columns, and the class that just gets some
#     data from each item an outputs it.
# 
#     We use this hack with _counter to make sure that the columns end
#     up in the same order as when declared. Each column must set a
#     name, which is used in as the heading for that column, and can
#     optionally set an attr or an attr_list. attr='foo' is equivalent
#     to attr_list=['foo'] and attr_list=['foo', 'bar', 'baz'] will
#     attempt to get item.foo.bar.baz for each item in the iterable
#     given to the table. If item.foo.bar is None, then this process
#     will terminate and will not error. However, if item.foo.bar is an
#     object without an attribute 'baz', then this will currently error.
# 
#     """
# 
#     _counter = 0
# 
#     def __init__(self, name, attr=None, attr_list=None,
#                  allow_sort=True, show=True,
#                  th_html_attrs=None, td_html_attrs=None,
#                  column_html_attrs=None):
#         self.name = name
#         self.allow_sort = allow_sort
#         self._counter_val = Col._counter
#         self.attr_list = attr_list
#         if attr:
#             self.attr_list = attr.split('.')
#         self.show = show
# 
#         column_html_attrs = column_html_attrs or {}
#         self.td_html_attrs = column_html_attrs.copy()
#         self.td_html_attrs.update(td_html_attrs or {})
#         self.th_html_attrs = column_html_attrs.copy()
#         self.th_html_attrs.update(th_html_attrs or {})
# 
#         Col._counter += 1
# 
#     def get_attr_list(self, attr):
#         if self.attr_list:
#             return self.attr_list
#         elif attr:
#             return attr.split('.')
#         else:
#             return None
# 
#     def from_attr_list(self, item, attr_list):
#         out = _recursive_getattr(item, attr_list)
#         if out is None:
#             return ''
#         else:
#             return out
# 
#     def td(self, item, attr):
#         content = self.td_contents(item, self.get_attr_list(attr))
#         return element(
#             'td',
#             content=content,
#             escape_content=False,
#             attrs=self.td_html_attrs)
# 
#     def td_contents(self, item, attr_list):
#         """Given an item and an attr, return the contents of the td.
# 
#         This method is a likely candidate to override when extending
#         the Col class, which is done in LinkCol and
#         ButtonCol. Override this method if you need to get some extra
#         data from the item.
# 
#         Note that the output of this function is NOT escaped.
# 
#         """
#         return self.td_format(self.from_attr_list(item, attr_list))
# 
#     def td_format(self, content):
#         """Given just the value extracted from the item, return what should
#         appear within the td.
# 
#         This method is also a good choice to override when extending,
#         which is done in the BoolCol, DateCol and DatetimeCol
#         classes. Override this method when you just need the standard
#         data that attr_list gets from the item, but need to adjust how
#         it is represented.
# 
#         Note that the output of this function is escaped.
# 
#         """
#         return Markup.escape(content)


from flask_table import create_table, Col


def main():
    TableCls = create_table()\
        .add_column('name', Col('Name'))\

# Path: flask_table/table.py
# def create_table(name=str('_Table'), base=Table, options=None):
#     """Creates and returns a new table class. You can specify a name for
#     you class if you wish. You can also set the base class (or
#     classes) that should be used when creating the class.
# 
#     """
#     try:
#         base = tuple(base)
#     except TypeError:
#         # Then assume that what we have is a single class, so make it
#         # into a 1-tuple.
#         base = (base,)
# 
#     return TableMeta(name, base, options or {})
# 
# Path: flask_table/columns.py
# class Col(object):
#     """The subclass for all Columns, and the class that just gets some
#     data from each item an outputs it.
# 
#     We use this hack with _counter to make sure that the columns end
#     up in the same order as when declared. Each column must set a
#     name, which is used in as the heading for that column, and can
#     optionally set an attr or an attr_list. attr='foo' is equivalent
#     to attr_list=['foo'] and attr_list=['foo', 'bar', 'baz'] will
#     attempt to get item.foo.bar.baz for each item in the iterable
#     given to the table. If item.foo.bar is None, then this process
#     will terminate and will not error. However, if item.foo.bar is an
#     object without an attribute 'baz', then this will currently error.
# 
#     """
# 
#     _counter = 0
# 
#     def __init__(self, name, attr=None, attr_list=None,
#                  allow_sort=True, show=True,
#                  th_html_attrs=None, td_html_attrs=None,
#                  column_html_attrs=None):
#         self.name = name
#         self.allow_sort = allow_sort
#         self._counter_val = Col._counter
#         self.attr_list = attr_list
#         if attr:
#             self.attr_list = attr.split('.')
#         self.show = show
# 
#         column_html_attrs = column_html_attrs or {}
#         self.td_html_attrs = column_html_attrs.copy()
#         self.td_html_attrs.update(td_html_attrs or {})
#         self.th_html_attrs = column_html_attrs.copy()
#         self.th_html_attrs.update(th_html_attrs or {})
# 
#         Col._counter += 1
# 
#     def get_attr_list(self, attr):
#         if self.attr_list:
#             return self.attr_list
#         elif attr:
#             return attr.split('.')
#         else:
#             return None
# 
#     def from_attr_list(self, item, attr_list):
#         out = _recursive_getattr(item, attr_list)
#         if out is None:
#             return ''
#         else:
#             return out
# 
#     def td(self, item, attr):
#         content = self.td_contents(item, self.get_attr_list(attr))
#         return element(
#             'td',
#             content=content,
#             escape_content=False,
#             attrs=self.td_html_attrs)
# 
#     def td_contents(self, item, attr_list):
#         """Given an item and an attr, return the contents of the td.
# 
#         This method is a likely candidate to override when extending
#         the Col class, which is done in LinkCol and
#         ButtonCol. Override this method if you need to get some extra
#         data from the item.
# 
#         Note that the output of this function is NOT escaped.
# 
#         """
#         return self.td_format(self.from_attr_list(item, attr_list))
# 
#     def td_format(self, content):
#         """Given just the value extracted from the item, return what should
#         appear within the td.
# 
#         This method is also a good choice to override when extending,
#         which is done in the BoolCol, DateCol and DatetimeCol
#         classes. Override this method when you just need the standard
#         data that attr_list gets from the item, but need to adjust how
#         it is represented.
# 
#         Note that the output of this function is escaped.
# 
#         """
#         return Markup.escape(content)


# Path: examples/dynamic.py
from flask_table import create_table, Col



def main():
    TableCls = create_table()\
        .add_column('name', Col('Name'))\

        .add_column('description', Col('Description'))