funcnodes-react-flow 0.1.5__tar.gz → 0.1.6__tar.gz
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.
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/PKG-INFO +1 -1
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/run.py +43 -8
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/pyproject.toml +2 -1
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/README.md +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/__init__.py +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/__main__.py +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/android-chrome-192x192.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/android-chrome-512x512.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/apple-touch-icon.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/asset-manifest.json +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/css/style.css +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/favicon-16x16.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/favicon-32x32.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/favicon.ico +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/index.html +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/js/830.js +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/js/830.js.LICENSE.txt +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/js/main.js +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/js/main.js.LICENSE.txt +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/logo.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/logo192.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/logo512.png +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/manifest.json +0 -0
- {funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/robots.txt +0 -0
@@ -1,3 +1,4 @@
|
|
1
|
+
from typing import Optional
|
1
2
|
import http.server
|
2
3
|
import socketserver
|
3
4
|
import webbrowser
|
@@ -5,6 +6,7 @@ import os
|
|
5
6
|
import time
|
6
7
|
import threading
|
7
8
|
import asyncio
|
9
|
+
import funcnodes as fn
|
8
10
|
|
9
11
|
PORT = 8029
|
10
12
|
|
@@ -25,15 +27,18 @@ class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
|
|
25
27
|
self.send_error(405, "Method Not Allowed")
|
26
28
|
|
27
29
|
def get_worker_manager(self):
|
28
|
-
import funcnodes as fn
|
29
|
-
|
30
30
|
# Implement custom GET handling logic here
|
31
|
-
asyncio.run(
|
31
|
+
asyncio.run(
|
32
|
+
fn.worker.worker_manager.assert_worker_manager_running(
|
33
|
+
host=self.server.worker_manager_host,
|
34
|
+
port=self.server.worker_manager_port,
|
35
|
+
)
|
36
|
+
)
|
32
37
|
self.send_response(200)
|
33
38
|
self.send_header("Content-type", "text/json")
|
34
39
|
self.end_headers()
|
35
40
|
self.wfile.write(
|
36
|
-
f"ws://{
|
41
|
+
f"ws://{self.server.worker_manager_host}:{self.server.worker_manager_port}".encode(
|
37
42
|
"utf-8"
|
38
43
|
)
|
39
44
|
)
|
@@ -54,7 +59,22 @@ class GracefulHTTPServer(socketserver.TCPServer):
|
|
54
59
|
allow_reuse_address = False
|
55
60
|
timeout = 5
|
56
61
|
|
57
|
-
def __init__(
|
62
|
+
def __init__(
|
63
|
+
self,
|
64
|
+
server_address,
|
65
|
+
RequestHandlerClass,
|
66
|
+
bind_and_activate=True,
|
67
|
+
worker_manager_host: Optional[str] = None,
|
68
|
+
worker_manager_port: Optional[int] = None,
|
69
|
+
):
|
70
|
+
if worker_manager_host is None:
|
71
|
+
worker_manager_host = fn.config.CONFIG["worker_manager"]["host"]
|
72
|
+
|
73
|
+
if worker_manager_port is None:
|
74
|
+
worker_manager_port = fn.config.CONFIG["worker_manager"]["port"]
|
75
|
+
|
76
|
+
self.worker_manager_host = worker_manager_host
|
77
|
+
self.worker_manager_port = worker_manager_port
|
58
78
|
super().__init__(server_address, RequestHandlerClass, bind_and_activate)
|
59
79
|
self._is_serving = True
|
60
80
|
|
@@ -71,14 +91,29 @@ def _open_browser(port, delay=1.0):
|
|
71
91
|
webbrowser.open(f"http://localhost:{port}")
|
72
92
|
|
73
93
|
|
74
|
-
def run_server(
|
94
|
+
def run_server(
|
95
|
+
port=PORT,
|
96
|
+
open_browser=True,
|
97
|
+
worker_manager_host: Optional[str] = None,
|
98
|
+
worker_manager_port: Optional[int] = None,
|
99
|
+
):
|
75
100
|
import funcnodes as fn
|
76
101
|
|
77
|
-
asyncio.run(
|
102
|
+
asyncio.run(
|
103
|
+
fn.worker.worker_manager.assert_worker_manager_running(
|
104
|
+
host=worker_manager_host,
|
105
|
+
port=worker_manager_port,
|
106
|
+
)
|
107
|
+
)
|
78
108
|
try:
|
79
109
|
script_directory = os.path.dirname(os.path.abspath(__file__))
|
80
110
|
os.chdir(script_directory)
|
81
|
-
httpd = GracefulHTTPServer(
|
111
|
+
httpd = GracefulHTTPServer(
|
112
|
+
("", port),
|
113
|
+
CustomHTTPRequestHandler,
|
114
|
+
worker_manager_host=worker_manager_host,
|
115
|
+
worker_manager_port=worker_manager_port,
|
116
|
+
)
|
82
117
|
print(f"Serving at port {port}")
|
83
118
|
if open_browser:
|
84
119
|
threading.Thread(target=_open_browser, args=(port,), daemon=True).start()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "funcnodes_react_flow"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.6"
|
4
4
|
description = "funcnodes frontend for react flow"
|
5
5
|
authors = ["Julian Kimmig <julian.kimmig@linkdlab.de>"]
|
6
6
|
readme = "README.md"
|
@@ -10,6 +10,7 @@ python = ">=3.11"
|
|
10
10
|
funcnodes = "*"
|
11
11
|
|
12
12
|
[tool.poetry.group.dev.dependencies]
|
13
|
+
pytest = "*"
|
13
14
|
|
14
15
|
[build-system]
|
15
16
|
requires = ["poetry-core"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/apple-touch-icon.png
RENAMED
File without changes
|
{funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/asset-manifest.json
RENAMED
File without changes
|
{funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/css/style.css
RENAMED
File without changes
|
{funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/favicon-16x16.png
RENAMED
File without changes
|
{funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/favicon-32x32.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/js/830.js.LICENSE.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{funcnodes_react_flow-0.1.5 → funcnodes_react_flow-0.1.6}/funcnodes_react_flow/manifest.json
RENAMED
File without changes
|
File without changes
|