MilanM commited on
Commit
3d18fe0
·
verified ·
1 Parent(s): 218f5b4

Update main_app.py

Browse files
Files changed (1) hide show
  1. main_app.py +3 -6
main_app.py CHANGED
@@ -600,7 +600,7 @@ def _(mo, template, template_variant):
600
 
601
  @app.cell
602
  def _(ast, function_editor, mo, os):
603
- function_name = None
604
  if function_editor.value:
605
  # Get the edited code from the function editor
606
  code = function_editor.value["editor"]
@@ -1270,16 +1270,13 @@ def _(
1270
  ):
1271
  if selection_table.value is not None:
1272
  # Create the input fields
1273
- if function_name is not None:
1274
- fnc_nm = function_name
1275
- else:
1276
- fnc_nm = "custom_pythoN_functin"
1277
 
1278
  uploaded_function_name = mo.ui.text(
1279
  placeholder="<Must be the same as the name in editor>",
1280
  label="Function Name:",
1281
  kind="text",
1282
- value=f"{fnc_nm}",
1283
  full_width=False,
1284
  )
1285
  tags_editor = mo.ui.array(
 
600
 
601
  @app.cell
602
  def _(ast, function_editor, mo, os):
603
+ function_name = template["function_name"] or "your_python_function"
604
  if function_editor.value:
605
  # Get the edited code from the function editor
606
  code = function_editor.value["editor"]
 
1270
  ):
1271
  if selection_table.value is not None:
1272
  # Create the input fields
1273
+ fnc_nm = function_name
 
 
 
1274
 
1275
  uploaded_function_name = mo.ui.text(
1276
  placeholder="<Must be the same as the name in editor>",
1277
  label="Function Name:",
1278
  kind="text",
1279
+ value=fnc_nm,
1280
  full_width=False,
1281
  )
1282
  tags_editor = mo.ui.array(