From c6bd676789a40a100e9b1598af0da63453c9be76 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 17 Nov 2011 05:19:55 +0000 Subject: Skip all default namespaces added by rdflib. This is a bit of a kludge in that a prefix that matches default[0-9]* actually defined in the data file will not show up, but that's a pretty silly prefix name... --- lv2specgen/lv2specgen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lv2specgen') diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index f04a329..340aba2 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -1149,8 +1149,9 @@ def getNamespaces(m): """Return a prefix:URI dictionary of all namespaces seen during parsing""" nspaces = {} for prefix, uri in m.namespaces(): - nspaces[prefix] = uri - del nspaces['default1'] # Remove ugly default prefix added by rdflib + if not re.match('default[0-9]*', prefix): + # Skip silly default namespaces added by rdflib + nspaces[prefix] = uri return nspaces -- cgit v1.2.1