adtoolbox 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
adtoolbox/.DS_Store ADDED
Binary file
adtoolbox/__init__.py ADDED
@@ -0,0 +1,35 @@
1
+ import json
2
+ import os
3
+ import rich
4
+ from rich.prompt import Prompt
5
+
6
+ import sys
7
+
8
+ """Project Setup for ADToolBox."""
9
+
10
+ __version__ = "1.0.0"
11
+
12
+ sys.path.append(os.path.join(os.path.dirname(__file__)))
13
+
14
+ PKG_DATA=os.path.join(os.path.dirname(os.path.realpath(__file__)),"pkg_data")
15
+
16
+ with open(os.path.join(PKG_DATA,"ADToolbox_Configs.json"),"r") as f:
17
+ conf = json.load(f)
18
+ Main_Dir=conf["Base_Dir"]
19
+ if Main_Dir and os.path.exists(Main_Dir):
20
+ pass
21
+ elif Main_Dir and not os.path.exists(Main_Dir):
22
+ Main_Dir=input(f"Base directory is not configured properly.\nPlease input the correct path for the base directory:")
23
+ if not os.path.exists(Main_Dir):
24
+ os.makedirs(Main_Dir)
25
+ rich.print(f"[green]Base directory is set to {Main_Dir}")
26
+ else:
27
+ Main_Dir=Prompt.ask("No Base Directory Found: \nWhere do you want to store your ADToolBox Data?")
28
+
29
+ if not os.path.exists(Main_Dir):
30
+ os.mkdir(Main_Dir)
31
+ rich.print(f"\nDirectory did not exist. Created directory: {Main_Dir}")
32
+
33
+ with open(os.path.join(os.path.dirname(os.path.realpath(__file__)),"pkg_data","ADToolbox_Configs.json"),"w") as f:
34
+ conf["Base_Dir"]=Main_Dir
35
+ json.dump(conf,f)
adtoolbox/__main__.py ADDED
@@ -0,0 +1,7 @@
1
+ import sys
2
+ import os
3
+ from cli import main as main
4
+ import __init__
5
+
6
+ if __name__ == '__main__':
7
+ main()