From 717a6c7e263a0a21e62a48e5a73971dc2150e892 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 7 Nov 2011 03:44:46 +0000 Subject: Tidy. --- ext.wscript | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'ext.wscript') diff --git a/ext.wscript b/ext.wscript index 43f04c0..8595ae1 100644 --- a/ext.wscript +++ b/ext.wscript @@ -12,34 +12,33 @@ import waflib.Utils as Utils info = None try: + # Read version information from lv2extinfo.py (in a release tarball) import lv2extinfo info = lv2extinfo except: + # Read version information from RDF files try: import rdflib doap = rdflib.Namespace('http://usefulinc.com/ns/doap#') rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#') - dir = sys.path[0] - - m = rdflib.ConjunctiveGraph() + dir = sys.path[0] + m = rdflib.ConjunctiveGraph() m.parse(os.path.join(dir, 'manifest.ttl'), format='n3') spec = m.value(None, rdf.type, lv2.Specification) - uri = str(spec) - name = os.path.basename(uri.replace('http://', '')) - + name = os.path.basename(spec.replace('http://', '')) m.parse(os.path.join(dir, name + '.ttl'), format='n3') - pkgname = 'lv2-' + uri.replace('http://', '').replace('/', '-') - info = type('lv2extinfo', (object,), - {'NAME' : name, - 'MINOR' : int(m.value(spec, lv2.minorVersion, None)), - 'MICRO' : int(m.value(spec, lv2.microVersion, None)), - 'URI' : str(spec), - 'PKGCONFIG_NAME' : pkgname, - 'SHORTDESC' : str(m.value(spec, doap.shortdesc, None))}) + info = type('lv2extinfo', (object,), { + 'NAME' : name, + 'MINOR' : int(m.value(spec, lv2.minorVersion, None)), + 'MICRO' : int(m.value(spec, lv2.microVersion, None)), + 'URI' : str(spec), + 'PKGNAME' : 'lv2-' + spec.replace('http://', '').replace('/', '-') + 'SHORTDESC' : str(m.value(spec, doap.shortdesc, None))}) + except: e = sys.exc_info()[1] Logs.error('Error reading version information: ' + str(e)) -- cgit v1.2.1