Commit b37bc088 authored by Eric  DEVEAUD's avatar Eric DEVEAUD

allow no programs in libraries packages

parent 0634929c
......@@ -126,8 +126,15 @@ def info2progs(info):
progs = []
pack_name = info['name']
pack_version = info['version']
for elem in info['programs']:
if not 'programs' in info:
if not info['library']:
err(FATAL, '%s/%s: no program documented' % (pack_name, pack_version))
else:
do_document = []
else:
do_document = info['programs']
for elem in do_document:
new = {}
new['_id'] = _id_generator("prog", pack_name, pack_version, elem['name'])
new['type'] = 'program'
......@@ -152,8 +159,9 @@ def info2mobyle(info):
pack_version = info['version']
pattern= '(?P<name>[\w-]+)\s*\[(?P<desc>.*)\]'
auto = re.compile(pattern)
for prg in info['programs']:
# we already checked that packholds programs or not
to_document = info.get('programs', [])
for prg in to_document:
prog_name = prg['name']
# something to document ?
web = prg.get('web', False)
......@@ -296,7 +304,7 @@ if __name__ == '__main__':
pack_id = _id_generator("pack", pack_name)
pack_version = info['version']
pack_version_id = _id_generator("pack", pack_name, pack_version)
pack_doc = info2package(info)
pack_version_doc = info2pack_version(info)
program_docs = info2progs(info)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment