From e0b0ccd7dcd6bcffb6d94e6c29f5e83b3dbbb01f Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sun, 1 Apr 2018 11:23:14 +1000 Subject: [PATCH] updatetranslations script now grabs nickserv help entries --- updatetranslations.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/updatetranslations.py b/updatetranslations.py index f85558c6..8268f323 100755 --- a/updatetranslations.py +++ b/updatetranslations.py @@ -75,3 +75,22 @@ if __name__ == '__main__': print("help strings:") print(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': '))) + + # nickserv help entries + help_strings = [] + + for subdir, dirs, files in os.walk(arguments['']): + for fname in files: + filepath = subdir + os.sep + fname + if fname == 'nickserv.go': + content = open(filepath, 'r').read() + + matches = re.findall(r'\`([^\`]+)\`', content) + for match in matches: + if '\n' in match and match not in help_strings: + help_strings.append(match) + + print() + + print("nickserv help strings:") + print(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))