Commit a1c1abe8 authored by Lars Hupel's avatar Lars Hupel
Browse files

script to move 'NOTIFY' field from config to metadata

--HG--
branch : config
parent 8b99a24f5217
#!/usr/bin/env python3
from configparser import RawConfigParser
import os
import re
metadata = "metadata/metadata"
parser = RawConfigParser()
parser.read(metadata)
pat = re.compile(r"""^NOTIFY="(.*)"$""")
for entry in parser.sections():
config = os.path.join("thys", entry, "config")
if os.path.isfile(config):
with open(config, 'r') as f:
for line in f:
if line.startswith("NOTIFY"):
result = pat.match(line).group(1)
if result != "":
parser[entry]["notify"] = result
if "notify" not in parser[entry]:
parser[entry]["notify"] = ""
with open(metadata, 'w') as f:
parser.write(f)
......@@ -239,7 +239,8 @@ attribute_schema = {
'abstract': (False, None, None),
'license': (False, "parse_license", "BSD"),
'ignore': (True, None, ""),
'extra*': (False, "parse_extra", None)
'extra*': (False, "parse_extra", None),
'notify': (False, None, None)
}
### licenses
......
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