diff options
Diffstat (limited to 'Redim/config.py')
| -rw-r--r-- | Redim/config.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Redim/config.py b/Redim/config.py index 4bfa31a..de03ead 100644 --- a/Redim/config.py +++ b/Redim/config.py @@ -1,6 +1,8 @@ import json -from os import mkdir -from os.path import isdir, join +from time import time +from shutil import rmtree +from os import mkdir, listdir, environ +from os.path import isdir, join, getmtime class Config(): @@ -14,3 +16,8 @@ class Config(): with open(join(json_path, "config_redim"), "r") as f: configuration = json.load(f) return configuration + + def nettoyage_pyinstaller(self): + for i in listdir(environ["TMP"]): + if i.startswith("_MEI") and isdir(i) and (int(getmtime(join(environ["TMP"], i))) < (time() - 86400)): + rmtree(join(environ["TMP"], i)) |
