-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxDmongo.py
More file actions
26 lines (22 loc) · 800 Bytes
/
xDmongo.py
File metadata and controls
26 lines (22 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Author: VintellX
# Date created: 24/01/2024
# Just importing my old project's file for working with MongoDB
# As I'll be hosting this on my own server, I'll be using those files
import os
import sys
patho = sys.path
import importlib
def importo(VinDir):
patho.insert(0, VinDir)
for xDtrash in os.listdir(VinDir):
if xDtrash.endswith(".py") and not xDtrash.startswith("__"):
trashModule = xDtrash[:-3]
try:
trasho = importlib.import_module(trashModule)
print(f"+ {trashModule}")
except Exception as e:
print(f"- {trashModule}: {e}")
patho.pop(0)
if __name__ == "__main__":
xDir = "/home/VintellX/xDrag/Xanthe/pythonDocket/xDmongo/scripts"
# importo(xDir) # Uncomment this to import