# -*- coding: iso8859-1 -*- # # Copyright (C) 2006 CSIRO Australia # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of voluntary contributions made by many # individuals. For exact contribution history, see the revision # history and logs. # # Author: Conrad Parker from anxvalidator.pipeoutput import PipeOutput cmml_types = ['text/cmml'] cmml_errs = ['Error in formatting of time in a required tag', 'General parsing error', 'No cmml tag was found', 'No head tag was found', 'there is a head or a clip tag before the stream', 'there is a clip tag before the head tag', 'there are two stream tags', 'there are two head tags' ] cmml_sloppy = ['error in the formatting of an implied attribute', 'skipping an unknown tag', 'skipping a faulty tag', 'xmlns in cmml tag is wrongly redefined', 'clip with start time in the "past" skipped' ] class CMMLValidate (object): def __init__(self, f): self.o = PipeOutput ('cmml-validate -', f) def __str__(self): s = '

CMML markup validation:

' s += '
' + self.o.__str__() + '
' if (self.o.status == 0): s += '

This resource is valid CMML

' else: s += '

This resource is NOT valid CMML

' return s