Set the default metadata
This commit is contained in:
parent
8eacaf6a77
commit
dd906e20f4
1 changed files with 5 additions and 1 deletions
|
@ -68,11 +68,15 @@ def read_docstring(filename, verbose=True, ignore_errors=True):
|
||||||
# Metadata is per-file and a dict rather than per-plugin/function and yaml
|
# Metadata is per-file and a dict rather than per-plugin/function and yaml
|
||||||
data['metadata'] = extract_metadata(module_ast=M)[0]
|
data['metadata'] = extract_metadata(module_ast=M)[0]
|
||||||
|
|
||||||
# remove version
|
|
||||||
if data['metadata']:
|
if data['metadata']:
|
||||||
|
# remove version
|
||||||
for x in ('version', 'metadata_version'):
|
for x in ('version', 'metadata_version'):
|
||||||
if x in data['metadata']:
|
if x in data['metadata']:
|
||||||
del data['metadata'][x]
|
del data['metadata'][x]
|
||||||
|
else:
|
||||||
|
# Add default metadata
|
||||||
|
data['metadata'] = {'supported_by': 'community',
|
||||||
|
'status': ['preview']}
|
||||||
except:
|
except:
|
||||||
if verbose:
|
if verbose:
|
||||||
display.error("unable to parse %s" % filename)
|
display.error("unable to parse %s" % filename)
|
||||||
|
|
Loading…
Add table
Reference in a new issue