Skip to content

Instantly share code, notes, and snippets.

@r4nx
Created September 15, 2018 22:44
Show Gist options
  • Save r4nx/8add33a36fe5d9ffd74263c7c65d9351 to your computer and use it in GitHub Desktop.
Save r4nx/8add33a36fe5d9ffd74263c7c65d9351 to your computer and use it in GitHub Desktop.
from collections import defaultdict
import json
import os
def main():
here = os.path.abspath(os.path.dirname(__file__))
known_mods = {
'mopfix.cs': 'метла',
'quantumcrasher.sf': 'крашер',
'super_dgun.cs': 'дган',
'd3d9.dll': 's0beit / enb',
}
mods_extensions = ('.lua', '.luac', '.cs', '.sf', '.asi', '.dll')
mods_found = defaultdict(list)
for dirpath, dirnames, filenames in os.walk(here):
for mod in filenames:
ext = os.path.splitext(mod)[-1].strip().lower()
if ext not in mods_extensions:
continue
mods_found[ext].append(
'{} ({})'.format(mod, known_mods[mod.lower()]) if mod.lower() in known_mods else mod
)
print('Modifications found:{}{}'.format(os.linesep, json.dumps(mods_found, indent=4, sort_keys=True, ensure_ascii=False)))
input()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment