# Path: casacore/tables/tablehelper.py
# def _add_prefix(name):
#     """Add the prefix 'Table: ' to a table name to get a specific keyword value."""
#     return 'Table: ' + name
# 
# def _remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from one or more table names."""
#     if isinstance(name, string_types):
#         return _do_remove_prefix(name)
#     return [_do_remove_prefix(nm) for nm in name]
# 
# def _do_remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from a table name."""
#     res = name
#     if isinstance(res, string_types):
#         if res.find('Table: ') == 0:
#             res = res.replace('Table: ', '', 1)
#     return res
# 
# def _format_row(row, colnames, tab):
#     """
#     Helper function for _repr_html. Formats one row.
#     :param row: row of this table
#     :param colnames: vector of column names
#     :param tab: table, used to get the column keywords
#     :return: html-formatted row
#     """
#     out = ""
# 
#     out += "\n<tr>"
#     for colname in colnames:
#         out += "<td style='vertical-align:top; white-space:pre'>"
#         out += _format_cell(row[colname], tab.getcolkeywords(colname))
#         out += "</td>\n"
#     out += "</tr>\n"
#     return out


from six import string_types
from ._tables import (Table,
                      _default_ms,
                      _default_ms_subtable,
                      _required_ms_desc,
                      _complete_ms_desc)
from .tablehelper import (_add_prefix, _remove_prefix, _do_remove_prefix,
                          _format_row)
        from .tablerow import _tablerow
        from .tablecolumn import tablecolumn
        from .tablerow import tablerow
        from .tableiter import tableiter
        from .tableindex import tableindex
                    from casacore.tables import tabledelete
            from wxPython.wx import wxPySimpleApp
            from wxtablebrowser import CasaTestFrame
                        from casacore.tables import tabledelete
import six
        import casacore.util
            import casacore.tables.tableutil as pt
        import casacore.tables.tableutil as pt
        import os
                import wxPython
            import sys
        import os
        The contents of the columns with matching names are copied.
        The other arguments can be used to specify where to start copying.
        By default the entire input table is appended to the output table.
        Rows are added to the output table if needed.

        `startrowin`
          Row where to start in the input table.
        `startrowout`
          Row where to start in the output table,
          | -1 means write at the end of the output table.
        `nrow`
          Number of rows to copy
          | -1 means from startrowin till the end of the input table

        The following example appends row to the table itself, thus doubles
        the number of rows::

          t:=table('test.ms',readonly=F)
          t.copyrows(t)

        """
        self._copyrows(outtable, startrowin, startrowout, nrow)

    def iswritable(self):
        """Return if the table is writable."""
        return self._iswritable()

    def endianformat(self):
        """Return the endian format ('little' or 'big') in which the table
        is written."""

# Path: casacore/tables/tablehelper.py
# def _add_prefix(name):
#     """Add the prefix 'Table: ' to a table name to get a specific keyword value."""
#     return 'Table: ' + name
# 
# def _remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from one or more table names."""
#     if isinstance(name, string_types):
#         return _do_remove_prefix(name)
#     return [_do_remove_prefix(nm) for nm in name]
# 
# def _do_remove_prefix(name):
#     """Strip the possible prefix 'Table: ' from a table name."""
#     res = name
#     if isinstance(res, string_types):
#         if res.find('Table: ') == 0:
#             res = res.replace('Table: ', '', 1)
#     return res
# 
# def _format_row(row, colnames, tab):
#     """
#     Helper function for _repr_html. Formats one row.
#     :param row: row of this table
#     :param colnames: vector of column names
#     :param tab: table, used to get the column keywords
#     :return: html-formatted row
#     """
#     out = ""
# 
#     out += "\n<tr>"
#     for colname in colnames:
#         out += "<td style='vertical-align:top; white-space:pre'>"
#         out += _format_cell(row[colname], tab.getcolkeywords(colname))
#         out += "</td>\n"
#     out += "</tr>\n"
#     return out


# Path: casacore/tables/table.py
from six import string_types
from ._tables import (Table,
                      _default_ms,
                      _default_ms_subtable,
                      _required_ms_desc,
                      _complete_ms_desc)
from .tablehelper import (_add_prefix, _remove_prefix, _do_remove_prefix,
                          _format_row)
        from .tablerow import _tablerow
        from .tablecolumn import tablecolumn
        from .tablerow import tablerow
        from .tableiter import tableiter
        from .tableindex import tableindex
                    from casacore.tables import tabledelete
            from wxPython.wx import wxPySimpleApp
            from wxtablebrowser import CasaTestFrame
                        from casacore.tables import tabledelete
import six
        import casacore.util
            import casacore.tables.tableutil as pt
        import casacore.tables.tableutil as pt
        import os
                import wxPython
            import sys
        import os

        The contents of the columns with matching names are copied.
        The other arguments can be used to specify where to start copying.
        By default the entire input table is appended to the output table.
        Rows are added to the output table if needed.

        `startrowin`
          Row where to start in the input table.
        `startrowout`
          Row where to start in the output table,
          | -1 means write at the end of the output table.
        `nrow`
          Number of rows to copy
          | -1 means from startrowin till the end of the input table

        The following example appends row to the table itself, thus doubles
        the number of rows::

          t:=table('test.ms',readonly=F)
          t.copyrows(t)

        """
        self._copyrows(outtable, startrowin, startrowout, nrow)

    def iswritable(self):
        """Return if the table is writable."""
        return self._iswritable()

    def endianformat(self):
        """Return the endian format ('little' or 'big') in which the table
        is written."""

        return self._endianformat()