ScolaSync: Fichier source de src/test3.py

ScolaSync 5.1 |

test3.py
Aller à la documentation de ce fichier.
1 #!/usr/bin/python3
2
3 import os, os.path, re
4
5 python3safe=True
6
7 if __name__=="__main__":
8 files=os.listdir(".")
9 pattern=re.compile(".*\.py$")
10 files = [f for f in files if pattern.search(f) and "Ui_" not in f]
11 safe=[]
12 notsafe=[]
13 for f in files:
14 moduleName=f.replace(".py","")
15 try:
16 module=__import__(moduleName)
17 if module.python3safe:
18 safe.append(f)
19 except:
20 notsafe.append(f)
21 print ("Safe modules"); print(safe)
22 print ("UnSafe modules"); print (notsafe)
23