aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-11-17 05:19:55 +0000
committerDavid Robillard <d@drobilla.net>2011-11-17 05:19:55 +0000
commitc6bd676789a40a100e9b1598af0da63453c9be76 (patch)
treeabeee6fe450a4d3023c1fe5bb1c043be38d0a9d4 /lv2specgen
parenta87331accdaec222af6fe84cac0c703e334e5a5f (diff)
downloadlv2-c6bd676789a40a100e9b1598af0da63453c9be76.tar.xz
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...
Diffstat (limited to 'lv2specgen')
-rwxr-xr-xlv2specgen/lv2specgen.py5
1 files changed, 3 insertions, 2 deletions
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