mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 22:49:53 -05:00
test
This commit is contained in:
parent
8bd37324ab
commit
ca4f35aae5
@ -126,28 +126,36 @@ class Spicemanip():
|
|||||||
str(self.task) + " is not a valid spicemanip function.")
|
str(self.task) + " is not a valid spicemanip function.")
|
||||||
|
|
||||||
def core_output_handler(self):
|
def core_output_handler(self):
|
||||||
if not self.output_type:
|
|
||||||
self.output_type = "list"
|
core_defaults = {
|
||||||
self.outputs = self.inputs_list
|
'string': "string",
|
||||||
|
'number': "string",
|
||||||
|
'rangebetween': "string",
|
||||||
|
'exclude': "string",
|
||||||
|
'random': "string",
|
||||||
|
'incrange_plus': "string",
|
||||||
|
'incrange_minus': "string",
|
||||||
|
'excrange_plus': "string",
|
||||||
|
'excrange_minus': "string",
|
||||||
|
'count': "dict"
|
||||||
|
}
|
||||||
|
|
||||||
# default return if not specified
|
# default return if not specified
|
||||||
if self.output_type == 'default':
|
if self.output_type == 'default':
|
||||||
if self.task in [
|
if self.task in list(core_defaults.keys()):
|
||||||
'string', 'number', 'rangebetween', 'exclude', 'random',
|
self.output_type = core_defaults[self.task]
|
||||||
'incrange_plus', 'incrange_minus', 'excrange_plus',
|
|
||||||
'excrange_minus'
|
|
||||||
]:
|
|
||||||
self.output_type = 'string'
|
|
||||||
elif self.task in ['count']:
|
|
||||||
self.output_type = 'dict'
|
|
||||||
|
|
||||||
# verify output is correct
|
# verify output is correct
|
||||||
if self.output_type == 'return':
|
if self.output_type in ['return', 'dict']:
|
||||||
return self.outputs
|
return
|
||||||
|
|
||||||
if self.output_type == 'string':
|
if self.output_type == 'string':
|
||||||
self.outputs = self.string(self.outputs)
|
self.outputs = self.string(self.outputs)
|
||||||
elif self.output_type in ['list', 'array']:
|
return
|
||||||
|
|
||||||
|
if self.output_type in ['list', 'array']:
|
||||||
self.outputs = self.list(self.outputs)
|
self.outputs = self.list(self.outputs)
|
||||||
|
return
|
||||||
|
|
||||||
# Convert list to string
|
# Convert list to string
|
||||||
def string(self, inputs):
|
def string(self, inputs):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user