Ejemplo n.º 1
0
def write_ignored(variables, outfile):
    raise NotImplementedError
    reason = '???'
    #if not isinstance(varid, DeclID):
    #    varid = getattr(varid, 'parsed', varid).id
    _tables.write_table(
        outfile,
        IGNORED_HEADER,
        sep='\t',
        rows=(r.render_rowdata() + (reason, ) for r in decls),
    )
Ejemplo n.º 2
0
def write_ignored(variables, outfile, relroot=fsutil.USE_CWD):
    raise NotImplementedError
    if relroot and relroot is not fsutil.USE_CWD:
        relroot = os.path.abspath(relroot)
    reason = '???'
    #if not isinstance(varid, DeclID):
    #    varid = getattr(varid, 'parsed', varid).id
    decls = (d.fix_filename(relroot, fixroot=False) for d in decls)
    _tables.write_table(
        outfile,
        IGNORED_HEADER,
        sep='\t',
        rows=(r.render_rowdata() + (reason,) for r in decls),
    )
Ejemplo n.º 3
0
def _write_decls_tsv(decls, outfile, extracolumns, relroot, kwargs):
    columns = _get_columns('decls', extracolumns)
    if extracolumns:

        def render_decl(decl):
            if type(row) is tuple:
                decl, *extra = decl
            else:
                extra = ()
            extra += ('???', ) * (len(extraColumns) - len(extra))
            *row, declaration = _render_known_row(decl, relroot)
            row += extra + (declaration, )
            return row
    else:
        render_decl = _render_known_decl
    _tables.write_table(outfile,
                        header='\t'.join(columns),
                        rows=(render_decl(d, relroot) for d in decls),
                        sep='\t',
                        **kwargs)
Ejemplo n.º 4
0
def write_parsed(items, outfile):
    # XXX Support other formats than TSV?
    columns = _get_columns('parsed')
    rows = (item.as_row(columns) for item in items)
    _tables.write_table(outfile, columns, rows, sep='\t', fix='-')