|
16 | 16 | # ANY USE OF THIS SCRIPT, WITHOUT PERMISSION IS BANNABLE OFFENSE AND REASON FOR LICENSE PROBLEMS! |
17 | 17 | # <=======================================================================> |
18 | 18 |
|
| 19 | +import os |
| 20 | +import subprocess |
| 21 | +def ModuleInstall(module): |
| 22 | + """Installs module |
| 23 | +
|
| 24 | + Args: |
| 25 | + module (str): Module name to install |
| 26 | + """ |
| 27 | + subprocess.check_call(['pip', 'install', module]) |
| 28 | + |
| 29 | +def ModuleUninstall(module): |
| 30 | + """Uninstalls module |
| 31 | +
|
| 32 | + Args: |
| 33 | + module (str): Module name to uninstall |
| 34 | + """ |
| 35 | + subprocess.check_call(['pip', 'uninstall', module]) |
| 36 | + |
19 | 37 | from .Config import * |
20 | 38 | from .Colors import * |
21 | 39 | try: |
22 | 40 | import ctypes |
23 | | - import subprocess |
24 | 41 | import os |
25 | 42 | import readchar |
26 | 43 | import time |
|
38 | 55 | import tempfile |
39 | 56 | import string |
40 | 57 | except Exception as e: |
41 | | - import os |
42 | | - print(f"[x] | Error Module (Restart Setup): {e}") |
43 | | - os.system("pause") |
| 58 | + ModuleInstall("readchar") |
| 59 | + ModuleInstall("requests") |
| 60 | + if sys.platform.startswith("win"): |
| 61 | + os.system("cls") |
| 62 | + elif sys.platform.startswith("linux"): |
| 63 | + os.system("clear") |
44 | 64 |
|
45 | 65 | # [ ! ] PRIORITY FUNCTIONS |
46 | 66 | # (these functions are used in utils) |
@@ -73,22 +93,6 @@ def time_day_hour_prefix(): return f"{RED}[ {WHITE}{current_time_day_hour()} {RE |
73 | 93 | bluesplittingline = f"———————————————————————————————————————————————————————————————————————————————————————————————————————————" |
74 | 94 |
|
75 | 95 | # FUNCTIONS |
76 | | - |
77 | | -def ModuleInstall(module): |
78 | | - """Installs module |
79 | | -
|
80 | | - Args: |
81 | | - module (str): Module name to install |
82 | | - """ |
83 | | - subprocess.check_call(['pip', 'install', module]) |
84 | | - |
85 | | -def ModuleUninstall(module): |
86 | | - """Uninstalls module |
87 | | -
|
88 | | - Args: |
89 | | - module (str): Module name to uninstall |
90 | | - """ |
91 | | - subprocess.check_call(['pip', 'uninstall', module]) |
92 | 96 |
|
93 | 97 | def MenuInput(): |
94 | 98 | """Makes input for main menu of BlueFruit |
|
0 commit comments