Move 'string' module and fix 'typeOf' function
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from smnp.module import system, mic, note, iterable, sound, synth
|
from smnp.module import system, mic, note, iterable, sound, synth, string
|
||||||
|
|
||||||
functions = [ *system.functions, *mic.functions, *note.functions, *iterable.functions, *sound.functions, *synth.functions ]
|
functions = [ *system.functions, *mic.functions, *note.functions, *iterable.functions, *sound.functions, *synth.functions, *string.functions ]
|
||||||
methods = [ *system.methods, *mic.methods, *note.methods, *iterable.methods, *sound.methods, *synth.methods ]
|
methods = [ *system.methods, *mic.methods, *note.methods, *iterable.methods, *sound.methods, *synth.methods, *string.functions ]
|
||||||
4
smnp/module/string/__init__.py
Normal file
4
smnp/module/string/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
from smnp.module.string.function import concat
|
||||||
|
|
||||||
|
functions = [ concat.function ]
|
||||||
|
methods = []
|
||||||
0
smnp/module/string/function/__init__.py
Normal file
0
smnp/module/string/function/__init__.py
Normal file
@@ -14,7 +14,7 @@ class Type(Enum):
|
|||||||
PERCENT = (float, lambda x: f"{int(x * 100)}%")
|
PERCENT = (float, lambda x: f"{int(x * 100)}%")
|
||||||
NOTE = (Note, lambda x: x.note.name)
|
NOTE = (Note, lambda x: x.note.name)
|
||||||
SOUND = (Sound, lambda x: x.file)
|
SOUND = (Sound, lambda x: x.file)
|
||||||
TYPE = (None, lambda x: str(x.type.name.lower()))
|
TYPE = (None, lambda x: x.name.lower())
|
||||||
VOID = (type(None), lambda x: _failStringify(Type.VOID))
|
VOID = (type(None), lambda x: _failStringify(Type.VOID))
|
||||||
|
|
||||||
def stringify(self, element):
|
def stringify(self, element):
|
||||||
|
|||||||
Reference in New Issue
Block a user