Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions forloop_modules/function_handlers/control_flow_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,24 +257,25 @@ def make_form_dict_list(self, *args, node_detail_form=None):
fdl.label("Value 2")
fdl.entry(name="value_q",text="",row=3)

fdl.label("Toggle channel")
fdl.button(function=self.toggle_channel, function_args=args, text="Toggle",row=4, focused=True)
fdl.label("Active channel")
fdl.checkbox(name="active_channel", bool_value=True, row=4)

fdl.label("Active channel: True")
#fdl.label(f"Current channel: ", row=5)

return fdl

def toggle_channel(self, args): #Refactor to backend
image = args[0]
elements = image.item_detail_form.elements
channel_str = elements[-1].text.split("Active channel: ")[1]
channel = ast.literal_eval(channel_str)
channel = not channel # toggle
elements[-1].text = "Active channel: " + str(channel)

print(args)
# def toggle_channel(self, args): #Refactor to backend
# image = args[0]
# elements = image.item_detail_form.elements
# channel_str = elements[-1].text.split("Active channel: ")[1]
# channel = ast.literal_eval(channel_str)
# channel = not channel # toggle
# elements[-1].text = "Active channel: " + str(channel)

def direct_execute(self, value_p, operator, value_q):
# print(args)

def direct_execute(self, value_p, operator, value_q, **kwargs):
# def __new__(cls, value_p, operator, value_q, *args, **kwargs):
try:
if isinstance(value_p, list) and operator == 'isempty':
Expand Down
Loading