ivoryos 0.1.7__py3-none-any.whl → 0.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ivoryos/__init__.py +1 -1
- ivoryos/routes/control/templates/control/controllers.html +1 -1
- ivoryos/routes/database/database.py +0 -9
- ivoryos/routes/design/design.py +10 -0
- ivoryos/routes/design/templates/design/experiment_builder.html +1 -1
- ivoryos/utils/form.py +3 -2
- {ivoryos-0.1.7.dist-info → ivoryos-0.1.8.dist-info}/METADATA +1 -1
- {ivoryos-0.1.7.dist-info → ivoryos-0.1.8.dist-info}/RECORD +11 -13
- ivoryos/static/logo.png +0 -0
- ivoryos/utils/task_manager.py +0 -80
- {ivoryos-0.1.7.dist-info → ivoryos-0.1.8.dist-info}/LICENSE +0 -0
- {ivoryos-0.1.7.dist-info → ivoryos-0.1.8.dist-info}/WHEEL +0 -0
- {ivoryos-0.1.7.dist-info → ivoryos-0.1.8.dist-info}/top_level.txt +0 -0
ivoryos/__init__.py
CHANGED
|
@@ -19,7 +19,7 @@ global_config = GlobalConfig()
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def create_app(config_class=None):
|
|
22
|
-
url_prefix = os.getenv('URL_PREFIX',
|
|
22
|
+
url_prefix = os.getenv('URL_PREFIX', "/ivoryos")
|
|
23
23
|
app = Flask(__name__, static_url_path=f'{url_prefix}/static', static_folder='static')
|
|
24
24
|
app.config.from_object(config_class or 'config.get_config()')
|
|
25
25
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
{% endfor %}
|
|
38
38
|
</div>
|
|
39
39
|
<div class="input-group mb-3">
|
|
40
|
-
<button type="submit" name="{{ function }}" id="{{ function }}" class="form-control" style="background-color: #a5cece;">{{function}} </button>
|
|
40
|
+
<button type="submit" name="{{ function }}" id="{{ function }}" class="form-control" style="background-color: #a5cece;">{{format_name(function)}} </button>
|
|
41
41
|
</div>
|
|
42
42
|
</form>
|
|
43
43
|
</div>
|
|
@@ -7,15 +7,6 @@ from ivoryos.utils.utils import get_script_file, post_script_file
|
|
|
7
7
|
database = Blueprint('database', __name__, template_folder='templates/database')
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
@database.route("/delete/<id>")
|
|
11
|
-
@login_required
|
|
12
|
-
def delete_action(id):
|
|
13
|
-
back = request.referrer
|
|
14
|
-
script = get_script_file()
|
|
15
|
-
script.delete_action(id)
|
|
16
|
-
post_script_file(script)
|
|
17
|
-
return redirect(back)
|
|
18
|
-
|
|
19
10
|
|
|
20
11
|
@database.route("/edit_workflow/<workflow_name>")
|
|
21
12
|
@login_required
|
ivoryos/routes/design/design.py
CHANGED
|
@@ -394,3 +394,13 @@ def edit_action(uuid):
|
|
|
394
394
|
flash(e.__str__())
|
|
395
395
|
session.pop('edit_action')
|
|
396
396
|
return redirect(url_for('design.experiment_builder'))
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
@design.route("/delete/<id>", methods=['GET', 'POST'])
|
|
400
|
+
@login_required
|
|
401
|
+
def delete_action(id):
|
|
402
|
+
back = request.referrer
|
|
403
|
+
script = utils.get_script_file()
|
|
404
|
+
script.delete_action(id)
|
|
405
|
+
utils.post_script_file(script)
|
|
406
|
+
return redirect(back)
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
{% for button in buttons %}
|
|
303
303
|
<li id="{{ button['id'] }}" style="list-style-type: none;">
|
|
304
304
|
<a href="{{ url_for('design.edit_action', uuid=button['uuid']) }}" type="button" class="btn btn-light" style="{{ button['style'] }}">{{ button['label'] }}</a>
|
|
305
|
-
<a href="
|
|
305
|
+
<a href="{{ url_for('design.delete_action', id=button['id']) }}" type="button" class="btn btn-light"><span class="bi bi-trash"></span></a>
|
|
306
306
|
</li>
|
|
307
307
|
{% endfor %}
|
|
308
308
|
</ul>
|
ivoryos/utils/form.py
CHANGED
|
@@ -220,7 +220,8 @@ def create_form_for_method(method, method_name, autofill, script=None, design=Tr
|
|
|
220
220
|
formatted_param_name = format_name(param.name)
|
|
221
221
|
field_kwargs = {
|
|
222
222
|
"label": formatted_param_name,
|
|
223
|
-
"default": f'#{param.name}' if autofill else (param.default if param.default is not param.empty else
|
|
223
|
+
"default": f'#{param.name}' if autofill else (param.default if param.default is not param.empty else None),
|
|
224
|
+
"validators": [InputRequired()] if param.default is param.empty else None,
|
|
224
225
|
**({"script": script} if (autofill or design) else {})
|
|
225
226
|
}
|
|
226
227
|
field_class, placeholder_text = annotation_mapping.get(
|
|
@@ -255,7 +256,7 @@ def create_form_from_module(sdl_module, autofill: bool, script=None, design=True
|
|
|
255
256
|
attr = getattr(sdl_module, attr_name)
|
|
256
257
|
if inspect.ismethod(attr) and not attr_name.startswith('_'):
|
|
257
258
|
form_class = create_add_form(attr, attr_name, autofill, script, design)
|
|
258
|
-
method_forms[
|
|
259
|
+
method_forms[attr_name] = form_class()
|
|
259
260
|
return method_forms
|
|
260
261
|
|
|
261
262
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ivoryos/__init__.py,sha256=
|
|
1
|
+
ivoryos/__init__.py,sha256=0bjHffTf3m8NWU3zwLz7sZMDqhwNP9FpNXJhxFRliEQ,3938
|
|
2
2
|
ivoryos/config.py,sha256=K03jdGmbUfJ9o4kK6NOtDGJtydGHFq8-oU8nvCyq5zQ,1358
|
|
3
3
|
ivoryos/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
ivoryos/routes/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -7,22 +7,21 @@ ivoryos/routes/auth/templates/auth/login.html,sha256=1uxYU7NpxVaA4sfwkC6CuzZXJdy
|
|
|
7
7
|
ivoryos/routes/auth/templates/auth/signup.html,sha256=QQ7n4OBnF8TNFS5_4s11n4BCqSePn429rZfA6vO8qw8,1497
|
|
8
8
|
ivoryos/routes/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
ivoryos/routes/control/control.py,sha256=YKM1T_bDIggbW_NF6Ld6-rb3d0KbAjyikJztN-ka_XM,11305
|
|
10
|
-
ivoryos/routes/control/templates/control/controllers.html,sha256=
|
|
10
|
+
ivoryos/routes/control/templates/control/controllers.html,sha256=5LKKlhiGdg2fxs-akAAxtm1AMF5HAiuSlputDBMeTc0,4159
|
|
11
11
|
ivoryos/routes/control/templates/control/controllers_home.html,sha256=IND1T3_mPZd-MzfuyodbedMnmsTowiTVdRp5ez6NoZM,2783
|
|
12
12
|
ivoryos/routes/control/templates/control/controllers_new.html,sha256=Wqn9x9D6K7RWHkLFxvZkzbIJxHJR1zywQ6WDgySXOig,5010
|
|
13
13
|
ivoryos/routes/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
ivoryos/routes/database/database.py,sha256=
|
|
14
|
+
ivoryos/routes/database/database.py,sha256=W7axqxlRyIwqdLCuzYzER33obz6PCkevk6NTy-sCOLw,4133
|
|
15
15
|
ivoryos/routes/database/templates/database/experiment_database.html,sha256=x9zf4u4KbG6BEICnH_TOVNNUkp5oAmGBB12OUX0PPl4,3506
|
|
16
16
|
ivoryos/routes/design/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
ivoryos/routes/design/design.py,sha256=
|
|
18
|
-
ivoryos/routes/design/templates/design/experiment_builder.html,sha256=
|
|
17
|
+
ivoryos/routes/design/design.py,sha256=sbGkd9GztrNsY0vvvC4wZ9O1_rRS1f5dqkAYCATgvdM,17156
|
|
18
|
+
ivoryos/routes/design/templates/design/experiment_builder.html,sha256=HIkb-llvEy57agHuaiSN95tKj4Oh0T88GBfHxEsz8bI,27399
|
|
19
19
|
ivoryos/routes/design/templates/design/experiment_run.html,sha256=xoEHH8CC83KCWTPavwP9JWUI8SE5HX9bkEfJN6vMg5s,22845
|
|
20
20
|
ivoryos/routes/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
ivoryos/routes/main/main.py,sha256=Zkagtw0E67FaspNJ87jkYpc-wqqoTq99dyyB7qdnOVM,655
|
|
22
22
|
ivoryos/routes/main/templates/main/help.html,sha256=TY6uD-v8MXpiZlGucchko1Bas5jHRzARIgCgneBZ_ok,9511
|
|
23
23
|
ivoryos/routes/main/templates/main/home.html,sha256=fjeSSXkuVDr2y-CQmskNHf1yYFFdrPPI4wn6_XPb6AY,3252
|
|
24
24
|
ivoryos/static/favicon.ico,sha256=RhlrPtfITOkzC9BjP1UB1V5L9Oyp6NwNtWeMcGOnpyc,15406
|
|
25
|
-
ivoryos/static/logo.png,sha256=7lNyToDllflGPUK2sj7IBR8FkHLC-6gi-OVSL9o4jrs,63464
|
|
26
25
|
ivoryos/static/logo.webp,sha256=lXgfQR-4mHTH83k7VV9iB54-oC2ipe6uZvbwdOnLETc,14974
|
|
27
26
|
ivoryos/static/style.css,sha256=rY6n2mbP_xNavtVin_yUqtcvNm6uqAF82t7ONE2Sx9E,3918
|
|
28
27
|
ivoryos/static/gui_annotation/Slide1.png,sha256=Lm4gdOkUF5HIUFaB94tl6koQVkzpitKj43GXV_XYMMc,121727
|
|
@@ -34,14 +33,13 @@ ivoryos/static/js/sortable_design.js,sha256=BxNXzqET_yY0xpS1Fc0iwPCnkkDwYMiuVqkg
|
|
|
34
33
|
ivoryos/templates/base.html,sha256=KcKMjITaaC23yzIRN535uMhzv5x96nJl245Y2GaqdsM,7943
|
|
35
34
|
ivoryos/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
35
|
ivoryos/utils/db_models.py,sha256=umEATdxDP-sR_AMaLrOW2PBUcmBf1w38DLeFkBvVjJE,19280
|
|
37
|
-
ivoryos/utils/form.py,sha256=
|
|
36
|
+
ivoryos/utils/form.py,sha256=FcrexHxcykoQke2J78mDQf1PRAcXlMHwi-JZMgGBpOU,12316
|
|
38
37
|
ivoryos/utils/global_config.py,sha256=JCQvmZB0pNC-EjveRu48Tp4uvcNwn9DP3Ema6Xd9fJY,1656
|
|
39
38
|
ivoryos/utils/llm_agent.py,sha256=z0DIpZzc-z09p-diUZIOE5L9zfFW8RwseFjbfUvEqoQ,6596
|
|
40
39
|
ivoryos/utils/script_runner.py,sha256=gtqiHy4-40j5FMERXrmGb4jb9RAPzjCR345PMPduDno,7120
|
|
41
|
-
ivoryos/utils/task_manager.py,sha256=xfQ1s9ywWDrCYYpdgliVvoWED0s2xARmo3LXvAy6fgY,2517
|
|
42
40
|
ivoryos/utils/utils.py,sha256=BMmvyBNo8PYs-MiBiiHjYPvSwrHORofbNwhPYpaVnfI,15249
|
|
43
|
-
ivoryos-0.1.
|
|
44
|
-
ivoryos-0.1.
|
|
45
|
-
ivoryos-0.1.
|
|
46
|
-
ivoryos-0.1.
|
|
47
|
-
ivoryos-0.1.
|
|
41
|
+
ivoryos-0.1.8.dist-info/LICENSE,sha256=psyqat4GJkzi42551i0kH-bXLbEzrQEnjPDwy2TVhv8,1105
|
|
42
|
+
ivoryos-0.1.8.dist-info/METADATA,sha256=8t3dDdrj62BKNKuOMKS1FOwlPur9rox_4F9_x9haIYk,6101
|
|
43
|
+
ivoryos-0.1.8.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
44
|
+
ivoryos-0.1.8.dist-info/top_level.txt,sha256=FRIWWdiEvRKqw-XfF_UK3XV0CrnNb6EmVbEgjaVazRM,8
|
|
45
|
+
ivoryos-0.1.8.dist-info/RECORD,,
|
ivoryos/static/logo.png
DELETED
|
Binary file
|
ivoryos/utils/task_manager.py
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import threading
|
|
2
|
-
import queue
|
|
3
|
-
import time
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# A task manager class to manage the queue and tasks
|
|
7
|
-
class TaskManager:
|
|
8
|
-
def __init__(self):
|
|
9
|
-
self.task_queue = queue.Queue()
|
|
10
|
-
self.current_task = None
|
|
11
|
-
self.stop_event = threading.Event()
|
|
12
|
-
|
|
13
|
-
def add_task(self, func, **kwargs):
|
|
14
|
-
# Add the function and its kwargs to the task queue
|
|
15
|
-
self.task_queue.put((func, kwargs))
|
|
16
|
-
|
|
17
|
-
def run_tasks(self):
|
|
18
|
-
# Run the tasks from the queue
|
|
19
|
-
while not self.task_queue.empty():
|
|
20
|
-
func, kwargs = self.task_queue.get()
|
|
21
|
-
thread = threading.Thread(target=self.run_task, args=(func, kwargs))
|
|
22
|
-
self.current_task = thread
|
|
23
|
-
thread.start()
|
|
24
|
-
thread.join() # Wait for the task to finish
|
|
25
|
-
|
|
26
|
-
def run_task(self, func, kwargs):
|
|
27
|
-
# Run the task function with control to stop in the middle
|
|
28
|
-
self.stop_event.clear() # Reset the stop flag
|
|
29
|
-
func(**kwargs)
|
|
30
|
-
if self.stop_event.is_set():
|
|
31
|
-
print("Current task was stopped.")
|
|
32
|
-
|
|
33
|
-
def stop_current_task(self):
|
|
34
|
-
# Stop the current task by setting the stop flag
|
|
35
|
-
if self.current_task and self.current_task.is_alive():
|
|
36
|
-
print("Stopping current task...")
|
|
37
|
-
self.stop_event.set() # Signal to stop the current task
|
|
38
|
-
self.current_task.join() # Wait for the task to stop
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# Wrapping tasks to allow stopping between them
|
|
42
|
-
def function_to_call(stop_event, **kwargs):
|
|
43
|
-
if stop_event.is_set():
|
|
44
|
-
return
|
|
45
|
-
task1(kwargs['arg1'])
|
|
46
|
-
if stop_event.is_set():
|
|
47
|
-
return
|
|
48
|
-
task2(kwargs['arg2'])
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
# Dummy task functions as provided
|
|
52
|
-
def task1(arg1):
|
|
53
|
-
for i in range(arg1):
|
|
54
|
-
print(f"Task 1 running: {i}")
|
|
55
|
-
time.sleep(1)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def task2(arg2):
|
|
59
|
-
for i in range(arg2):
|
|
60
|
-
print(f"Task 2 running: {i}")
|
|
61
|
-
time.sleep(1)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if __name__ == "__main__":
|
|
65
|
-
manager = TaskManager()
|
|
66
|
-
|
|
67
|
-
# Add tasks to the manager
|
|
68
|
-
manager.add_task(function_to_call, stop_event=manager.stop_event, arg1=3, arg2=5)
|
|
69
|
-
manager.add_task(function_to_call, stop_event=manager.stop_event, arg1=2, arg2=4)
|
|
70
|
-
|
|
71
|
-
# Run tasks in a separate thread
|
|
72
|
-
manager_thread = threading.Thread(target=manager.run_tasks)
|
|
73
|
-
manager_thread.start()
|
|
74
|
-
|
|
75
|
-
# Example: Stop the current workflow while task1 is running
|
|
76
|
-
time.sleep(2) # Let task1 run for a bit
|
|
77
|
-
manager.stop_current_task()
|
|
78
|
-
|
|
79
|
-
# Wait for all tasks to finish
|
|
80
|
-
manager_thread.join()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|