Browse Source

updatetranslations script now grabs nickserv help entries

tags/v0.11.0-beta
Daniel Oaks 6 years ago
parent
commit
e0b0ccd7dc
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      updatetranslations.py

+ 19
- 0
updatetranslations.py View File

@@ -75,3 +75,22 @@ if __name__ == '__main__':
75 75
 
76 76
         print("help strings:")
77 77
         print(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))
78
+
79
+        # nickserv help entries
80
+        help_strings = []
81
+
82
+        for subdir, dirs, files in os.walk(arguments['<irc-dir>']):
83
+            for fname in files:
84
+                filepath = subdir + os.sep + fname
85
+                if fname == 'nickserv.go':
86
+                    content = open(filepath, 'r').read()
87
+
88
+                    matches = re.findall(r'\`([^\`]+)\`', content)
89
+                    for match in matches:
90
+                        if '\n' in match and match not in help_strings:
91
+                            help_strings.append(match)
92
+
93
+        print()
94
+
95
+        print("nickserv help strings:")
96
+        print(json.dumps({k:k for k in help_strings}, sort_keys=True, indent=2, separators=(',', ': ')))

Loading…
Cancel
Save