Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -155,13 +155,6 @@ class AppCreationProcess:
|
|
| 155 |
self.app_name = ""
|
| 156 |
self.components = []
|
| 157 |
|
| 158 |
-
def next_step(self):
|
| 159 |
-
self.current_step += 1
|
| 160 |
-
|
| 161 |
-
def previous_step(self):
|
| 162 |
-
if self.current_step > 1:
|
| 163 |
-
self.current_step -= 1
|
| 164 |
-
|
| 165 |
def get_current_step_info(self):
|
| 166 |
steps = {
|
| 167 |
1: "App Initialization",
|
|
@@ -329,7 +322,22 @@ with gr.Blocks() as iface:
|
|
| 329 |
terminal_input = gr.Textbox(label="Enter Command")
|
| 330 |
terminal_button = gr.Button("Run")
|
| 331 |
|
| 332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
app_process.next_step()
|
| 334 |
current_step_info = app_process.get_current_step_info()
|
| 335 |
visibility_updates = update_visibility(app_process.current_step)
|
|
@@ -349,7 +357,7 @@ with gr.Blocks() as iface:
|
|
| 349 |
step4_update,
|
| 350 |
step5_update
|
| 351 |
]
|
| 352 |
-
|
| 353 |
app_process.previous_step()
|
| 354 |
return app_process.get_current_step_info(), update_visibility(app_process.current_step)
|
| 355 |
|
|
@@ -357,7 +365,7 @@ with gr.Blocks() as iface:
|
|
| 357 |
prev_button.click(prev_step, outputs=[current_step, step1, step2, step3, step4, step5])
|
| 358 |
|
| 359 |
# Step 1: Initialize App
|
| 360 |
-
|
| 361 |
app_process.app_name = name
|
| 362 |
return f"App '{name}' initialized."
|
| 363 |
|
|
|
|
| 155 |
self.app_name = ""
|
| 156 |
self.components = []
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
def get_current_step_info(self):
|
| 159 |
steps = {
|
| 160 |
1: "App Initialization",
|
|
|
|
| 322 |
terminal_input = gr.Textbox(label="Enter Command")
|
| 323 |
terminal_button = gr.Button("Run")
|
| 324 |
|
| 325 |
+
# App Creation Process Class
|
| 326 |
+
class AppCreationProcess:
|
| 327 |
+
def __init__(self):
|
| 328 |
+
self.current_step = 1
|
| 329 |
+
self.app_name = ""
|
| 330 |
+
self.components = []
|
| 331 |
+
|
| 332 |
+
def get_current_step_info(self):
|
| 333 |
+
steps = {
|
| 334 |
+
1: "App Initialization",
|
| 335 |
+
2: "Component Addition",
|
| 336 |
+
3: "Property Configuration",
|
| 337 |
+
4: "Code Generation",
|
| 338 |
+
5: "Deployment"
|
| 339 |
+
|
| 340 |
+
def next_step():
|
| 341 |
app_process.next_step()
|
| 342 |
current_step_info = app_process.get_current_step_info()
|
| 343 |
visibility_updates = update_visibility(app_process.current_step)
|
|
|
|
| 357 |
step4_update,
|
| 358 |
step5_update
|
| 359 |
]
|
| 360 |
+
def prev_step():
|
| 361 |
app_process.previous_step()
|
| 362 |
return app_process.get_current_step_info(), update_visibility(app_process.current_step)
|
| 363 |
|
|
|
|
| 365 |
prev_button.click(prev_step, outputs=[current_step, step1, step2, step3, step4, step5])
|
| 366 |
|
| 367 |
# Step 1: Initialize App
|
| 368 |
+
def init_app(name):
|
| 369 |
app_process.app_name = name
|
| 370 |
return f"App '{name}' initialized."
|
| 371 |
|