\n"
extensions = []
for bundle in glob.glob(os.path.join(dir, '*.lv2')):
b = bundle.replace('.lv2', '')
b = b[b.find('/') + 1:]
# Get extension URI
ext = subprocess.Popen(['roqet', '-q', '-e', """
PREFIX lv2:
SELECT ?ext FROM <%s.lv2/%s.ttl> WHERE { ?ext a lv2:Specification }
""" % (os.path.join(dir, b), b)], stdout=subprocess.PIPE).communicate()[0]
if ext == "":
continue
ext = re.sub('^result: \[ext=uri<', '', ext)
ext = re.sub('>\]$', '', ext).strip()
# Get revision
query = """
PREFIX lv2:
PREFIX doap:
SELECT ?rev FROM <%s.lv2/%s.ttl> WHERE { <%s> doap:release [ doap:revision ?rev ] }
""" % (os.path.join(dir, b), b, ext)
rev = subprocess.Popen(['roqet', '-q', '-e', query],
stdout=subprocess.PIPE).communicate()[0]
if rev != '':
rev = re.sub('^result: \[rev=string\("', '', rev)
rev = re.sub('"\)\]$', '', rev).strip()
else:
rev = '0'
if rev != '0' and rev.find('pre') == -1:
path = os.path.join(os.path.abspath(release_dir), 'lv2-%s-%s.tar.gz' % (b, rev))
subprocess.call(['tar', '--exclude-vcs', '-czf', path,
bundle[bundle.find('/') + 1:]], cwd=dir)
specgendir = '../../../../lv2specgen/'
if (os.access(outdir + '/%s.lv2/%s.ttl' % (b, b), os.R_OK)):
print ' * Calling lv2specgen for %s%s/%s' %(URIPREFIX, dir, b)
subprocess.call([specgendir + 'lv2specgen.py',
'%s.lv2/%s.ttl' % (b, b),
specgendir + 'template.html',
STYLEURI,
'%s.lv2/%s.html' % (b, b),
os.path.join('..', '..', '..'),
'-i'], cwd=outdir);
li = '
'
if rev == '0':
li += 'Experimental: '
li += '%s' % (b, b)
li += '
'
extensions.append(li)
shutil.copy('doc/index.php', os.path.join(outdir, b + '.lv2', 'index.php'))
# Remove .lv2 suffix from bundle name (to make URI resolvable)
os.rename(outdir + '/%s.lv2' % b, outdir + '/%s' % b)
extensions.sort()
for i in extensions:
index_html += i + '\n'
index_html += '