|
9 | 9 | from pathlib import Path |
10 | 10 | import importlib |
11 | 11 | import sys |
12 | | - version, updated = '0.6.0', '12/4/2022' |
| 12 | + version, updated = '0.6.0', '12/8/2022' |
13 | 13 | varName, varVal, varType = [], [], [] |
14 | 14 | cMathInts, cMathSub, cMathMult, cMathDiv = [], 0, 0, 0 |
15 | 15 | mods = [] |
@@ -37,35 +37,30 @@ def welcomeDisp(): |
37 | 37 | cprint('Welcome Display Error: {S-002x}', 'red') |
38 | 38 |
|
39 | 39 | def moduleHandler(code): |
40 | | - if code == 'import': |
41 | | - cImp = input('What Module? ') |
42 | | - try: |
43 | | - importlib.import_module('SPY_' + cImp) |
44 | | - except: |
45 | | - cprint('Module ' + cImp + ' Not Found.', 'red') |
46 | | - elif '@' in code: |
47 | | - modN = code.replace('@', '') |
48 | | - modFunct = input('What Function? ') |
49 | | - modCall = getattr(modN, modFunct) |
50 | | - modOut = modCall() |
51 | | - return modOut |
| 40 | + if '@' in code: |
| 41 | + modN = ('SPY_' + code.replace('@', '')) |
| 42 | + cImp = __import__(modN) |
| 43 | + modin = input('What Function? ') |
| 44 | + func = getattr(cImp, 'init') |
| 45 | + return func(modin) |
52 | 46 |
|
53 | 47 | def inputHandler(code): |
54 | | - pH = printHandler(code) |
55 | | - if pH != None: return pH |
| 48 | + if '@' in code: |
| 49 | + modH = moduleHandler(code) |
| 50 | + return modH |
56 | 51 | else: |
57 | | - vH = varHandler(code) |
58 | | - if vH != None: return vH |
| 52 | + pH = printHandler(code) |
| 53 | + if pH != None: return pH |
59 | 54 | else: |
60 | | - txtH = txtHandler(code) |
61 | | - if txtH != None: return txtH |
| 55 | + vH = varHandler(code) |
| 56 | + if vH != None: return vH |
62 | 57 | else: |
63 | | - slashH = slashHandler(code) |
64 | | - if slashH != None: return slashH |
65 | | -# else: |
66 | | -# modH = moduleHandler(code) |
67 | | -# if modH != None: return modH |
68 | | - else: return '' |
| 58 | + txtH = txtHandler(code) |
| 59 | + if txtH != None: return txtH |
| 60 | + else: |
| 61 | + slashH = slashHandler(code) |
| 62 | + if slashH != None: return slashH |
| 63 | + else: return '' |
69 | 64 |
|
70 | 65 | def printHandler(code): |
71 | 66 | # Print Functions ### PUT BETA ON ECHO PRINT |
|
0 commit comments