From b46deb1417dc3596e9ac9fe2fe8cc0b7f42457e7 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 26 Oct 2015 06:29:00 +0000 Subject: "Any programmer who fails to comply with the standard naming, formatting, or commenting conventions should be shot. If it so happens that it is inconvenient to shoot him, then he is to be politely requested to recode his program in adherence to the above standard." -- Michael Spier, Digital Equipment Corporation svn path=/branches/tk705/; revision=6152 --- rpki/relaxng_parser.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'rpki/relaxng_parser.py') diff --git a/rpki/relaxng_parser.py b/rpki/relaxng_parser.py index 466b1a79..53ec8f0d 100644 --- a/rpki/relaxng_parser.py +++ b/rpki/relaxng_parser.py @@ -22,21 +22,21 @@ from an XML-format RelaxNG schema. import lxml.etree class RelaxNGParser(object): - """ - Parse schema, extract XML namespace and protocol version (if any). - Method calls are just passed along to the parsed RelaxNG schema. - """ + """ + Parse schema, extract XML namespace and protocol version (if any). + Method calls are just passed along to the parsed RelaxNG schema. + """ - def __init__(self, text): - xml = lxml.etree.fromstring(text) - self.schema = lxml.etree.RelaxNG(xml) - ns = xml.get("ns") - self.xmlns = "{" + ns + "}" - self.nsmap = { None : ns } - x = xml.xpath("ns0:define[@name = 'version']/ns0:value", - namespaces = dict(ns0 = "http://relaxng.org/ns/structure/1.0")) - if len(x) == 1: - self.version = x[0].text + def __init__(self, text): + xml = lxml.etree.fromstring(text) + self.schema = lxml.etree.RelaxNG(xml) + ns = xml.get("ns") + self.xmlns = "{" + ns + "}" + self.nsmap = { None : ns } + x = xml.xpath("ns0:define[@name = 'version']/ns0:value", + namespaces = dict(ns0 = "http://relaxng.org/ns/structure/1.0")) + if len(x) == 1: + self.version = x[0].text - def __getattr__(self, name): - return getattr(self.schema, name) + def __getattr__(self, name): + return getattr(self.schema, name) -- cgit v1.2.3