def _get_writer(self, path, generator): if not path: return NullMarkupWriter() try: writer = XmlWriter(path, encoding='UTF-8', write_empty=False) except EnvironmentError as err: raise DataError("Opening output file '%s' failed: %s" % (path, err.strerror)) writer.start('robot', {'generator': get_full_version(generator), 'generated': get_timestamp()}) return writer
def _get_writer(self, path, generator): if not path: return NullMarkupWriter() try: writer = XmlWriter(path, encoding='UTF-8', write_empty=False) except EnvironmentError as err: raise DataError("Opening output file '%s' failed: %s" % (path, err.strerror)) writer.start('robot', { 'generator': get_full_version(generator), 'generated': get_timestamp() }) return writer
def write(self, output): writer = XUnitFileWriter(XmlWriter(output), self._skip_noncritical) self._execution_result.visit(writer)
def write(self, libdoc, outfile): writer = XmlWriter(outfile) writer.start('keywordspec', {'name': libdoc.name, 'type': libdoc.type, 'format': libdoc.doc_format, 'generated': get_timestamp(millissep=None)}) writer.element('version', libdoc.version) writer.element('scope', libdoc.scope) writer.element('namedargs', 'yes' if libdoc.named_args else 'no') writer.element('doc', libdoc.doc) self._write_keywords('init', libdoc.inits, writer) self._write_keywords('kw', libdoc.keywords, writer) writer.end('keywordspec') writer.close()
def write(self, libdoc, outfile): writer = XmlWriter(outfile) writer.start( 'keywordspec', { 'name': libdoc.name, 'type': libdoc.type, 'format': libdoc.doc_format, 'generated': get_timestamp(millissep=None) }) writer.element('version', libdoc.version) writer.element('scope', libdoc.scope) writer.element('namedargs', 'yes' if libdoc.named_args else 'no') writer.element('doc', libdoc.doc) self._write_keywords('init', libdoc.inits, writer) self._write_keywords('kw', libdoc.keywords, writer) writer.end('keywordspec') writer.close()