#!/usr/bin/env python3 import fnmatch import os import re import ntpath import sys import argparse def get_private_declare(content): priv_declared = [] srch = re.compile('private.*') priv_srch_declared = srch.findall(content) priv_srch_declared = sorted(set(priv_srch_declared)) priv_dec_str = ''.join(priv_srch_declared) srch = re.compile('') priv_split = srch.findall(priv_dec_str) priv_split = sorted(set(priv_split)) priv_declared += priv_split; srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*') priv_srch_declared = srch.findall(content) priv_srch_declared = sorted(set(priv_srch_declared)) priv_dec_str = ''.join(priv_srch_declared) 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 = [] parser = argparse.ArgumentParser() parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") args = parser.parse_args() for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): 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()