def ReadTablesFromFiles(fileList, table_list, verbose=False):
    """
  Return a parsed document containing only the tables enumerated in
  table_list that appear in the files in fileList.
  """
    _is_table = _table_filter_generator(table_list)
    doc = ligolw.Document()
    searchsummary_handler = ligolw.PartialLIGOLWContentHandler(doc, _is_table)

    for thisFile in fileList:
        if thisFile.endswith(".gz"):
            fileobj = gzip.open(thisFile)
        else:
            fileobj = open(thisFile)
        ligolw.make_parser(searchsummary_handler).parse(fileobj)
    return doc
Exemplo n.º 2
0
 def ContentHandler(xmldoc):
   return ligolw.PartialLIGOLWContentHandler(xmldoc, lambda name, attrs:\
              (name == ligolw.Table.tagName) and\
              (table.StripTableName(attrs["Name"]) in ["segment_definer","segment_summary"]))
Exemplo n.º 3
0
 def ContentHandler(xmldoc):
     return ligolw.PartialLIGOLWContentHandler(xmldoc, lambda name, attrs:\
                        (name == ligolw.Table.tagName) and\
                        (table.StripTableName(attrs["Name"]) in tables))