diff --git a/tools/search_privates.py b/tools/search_privates.py new file mode 100644 index 0000000000..61ac155e64 --- /dev/null +++ b/tools/search_privates.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 + +import fnmatch +import os +import re +import ntpath +from pyparsing import * + + + + +def check_privates(filepath): + + def pushClosing(t): + closingStack.append(closing.expr) + closing << Literal( closingFor[t[0]] ) + + def popClosing(): + closing << closingStack.pop() + + with open(filepath, 'r') as file: + content = file.read() + + priv_use = [] + priv_use = [] + priv_declared = [] + + # Regex search privates + srch = re.compile('(? 0: + print filepath + for bad_priv in missing: + print '\t' + bad_priv + +def main(): + + print("#########################") + print("# Search your Privates #") + print("#########################") + + sqf_list = [] + for root, dirnames, filenames in os.walk('../addons'): + for filename in fnmatch.filter(filenames, '*.sqf'): + sqf_list.append(os.path.join(root, filename)) + + for filename in sqf_list: + check_privates(filename) + +if __name__ == "__main__": + main() \ No newline at end of file