Skip to content

Commit f1d7ff3

Browse files
committed
MODULE UPDATE --END OF SPY-EX 2022
1 parent e51a23a commit f1d7ff3

3 files changed

Lines changed: 31 additions & 32 deletions

File tree

SPY_moduleName.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

SPY_testMod.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Simpl-Py Module Test by Zer0 - Official
2+
3+
print('Welcome to testMod!')
4+
5+
def init(modin):
6+
if modin == 'test':
7+
return 'You did it!'
8+
elif modin == 'another test':
9+
return 'You did another one!'
10+
else:
11+
return 'not found.'

Simpl-Py.py

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pathlib import Path
1010
import importlib
1111
import sys
12-
version, updated = '0.6.0', '12/4/2022'
12+
version, updated = '0.6.0', '12/8/2022'
1313
varName, varVal, varType = [], [], []
1414
cMathInts, cMathSub, cMathMult, cMathDiv = [], 0, 0, 0
1515
mods = []
@@ -37,35 +37,30 @@ def welcomeDisp():
3737
cprint('Welcome Display Error: {S-002x}', 'red')
3838

3939
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)
5246

5347
def inputHandler(code):
54-
pH = printHandler(code)
55-
if pH != None: return pH
48+
if '@' in code:
49+
modH = moduleHandler(code)
50+
return modH
5651
else:
57-
vH = varHandler(code)
58-
if vH != None: return vH
52+
pH = printHandler(code)
53+
if pH != None: return pH
5954
else:
60-
txtH = txtHandler(code)
61-
if txtH != None: return txtH
55+
vH = varHandler(code)
56+
if vH != None: return vH
6257
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 ''
6964

7065
def printHandler(code):
7166
# Print Functions ### PUT BETA ON ECHO PRINT

0 commit comments

Comments
 (0)