Mercurial > dive4elements > river
view artifacts/contrib/find-obsolete-i18n-strings.py @ 8709:71ae18553377
(issue1754) Also fixup master artifact for already loaded recommendations
As the load many call creates (and needs to create) all artifacts
in the reccomendations this would break "old" recommendations after
a reload through the "Pencil" mode.
A better fix would probably be to just set the master artifiact
in the recommendations but due to the extremly weird interaction
with the server at this point it is not trivial to identify how
this can be done.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 24 Apr 2015 15:57:23 +0200 |
parents | 26971f97105f |
children |
line wrap: on
line source
#!/usr/bin/env python import os import re import sys KEY_RE = re.compile(r"^\s*([^\s=]+)\s*=.*$") def main(): content = [] for root, dirs, files in os.walk('.'): for f in files: if not (f.endswith(".java") or f.endswith(".xml")): continue p = os.path.join(root, f) with open(p, "rb") as jf: content.append(jf.read()) content = ''.join(content) for arg in sys.argv[1:]: with open(arg, "rb") as prop: for line in prop: m = KEY_RE.match(line) if not m: continue key = m.group(1) if content.find(key) == -1: print key if __name__ == "__main__": main()