funcnodes-react-flow 0.1.5__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.
Binary file
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,94 @@
1
+ import http.server
2
+ import socketserver
3
+ import webbrowser
4
+ import os
5
+ import time
6
+ import threading
7
+ import asyncio
8
+
9
+ PORT = 8029
10
+
11
+
12
+ class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
13
+ def do_GET(self):
14
+ if self.path == "/worker_manager":
15
+ self.get_worker_manager()
16
+ else:
17
+ # Call the superclass method to handle standard requests
18
+ super().do_GET()
19
+
20
+ def do_POST(self):
21
+ if self.path == "/custom-post":
22
+ self.handle_custom_post()
23
+ else:
24
+ # Send a 405 Method Not Allowed response for unsupported endpoints
25
+ self.send_error(405, "Method Not Allowed")
26
+
27
+ def get_worker_manager(self):
28
+ import funcnodes as fn
29
+
30
+ # Implement custom GET handling logic here
31
+ asyncio.run(fn.worker.worker_manager.assert_worker_manager_running())
32
+ self.send_response(200)
33
+ self.send_header("Content-type", "text/json")
34
+ self.end_headers()
35
+ self.wfile.write(
36
+ f"ws://{fn.config.CONFIG['worker_manager']['host']}:{fn.config.CONFIG['worker_manager']['port']}".encode(
37
+ "utf-8"
38
+ )
39
+ )
40
+
41
+ def handle_custom_post(self):
42
+ # Implement custom POST handling logic here
43
+ content_length = int(self.headers["Content-Length"])
44
+ post_data = self.rfile.read(content_length)
45
+
46
+ self.send_response(200)
47
+ self.send_header("Content-type", "text/html")
48
+ self.end_headers()
49
+ response = f"Received POST data: {post_data.decode('utf-8')}"
50
+ self.wfile.write(response.encode("utf-8"))
51
+
52
+
53
+ class GracefulHTTPServer(socketserver.TCPServer):
54
+ allow_reuse_address = False
55
+ timeout = 5
56
+
57
+ def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True):
58
+ super().__init__(server_address, RequestHandlerClass, bind_and_activate)
59
+ self._is_serving = True
60
+
61
+ def serve_forever(self, poll_interval=0.5):
62
+ while self._is_serving:
63
+ self.handle_request()
64
+
65
+ def shutdown(self):
66
+ self._is_serving = False
67
+
68
+
69
+ def _open_browser(port, delay=1.0):
70
+ time.sleep(delay)
71
+ webbrowser.open(f"http://localhost:{port}")
72
+
73
+
74
+ def run_server(port=PORT, open_browser=True):
75
+ import funcnodes as fn
76
+
77
+ asyncio.run(fn.worker.worker_manager.assert_worker_manager_running())
78
+ try:
79
+ script_directory = os.path.dirname(os.path.abspath(__file__))
80
+ os.chdir(script_directory)
81
+ httpd = GracefulHTTPServer(("", port), CustomHTTPRequestHandler)
82
+ print(f"Serving at port {port}")
83
+ if open_browser:
84
+ threading.Thread(target=_open_browser, args=(port,), daemon=True).start()
85
+ httpd.serve_forever()
86
+ except KeyboardInterrupt:
87
+ if httpd._is_serving:
88
+ print("Stopping server...")
89
+ httpd.shutdown()
90
+ print("Server has been stopped.")
91
+ else:
92
+ raise
93
+ except OSError as e:
94
+ print(f"Could not start server at port {port}: {e}")
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.1
2
+ Name: funcnodes_react_flow
3
+ Version: 0.1.5
4
+ Summary: funcnodes frontend for react flow
5
+ Author: Julian Kimmig
6
+ Author-email: julian.kimmig@linkdlab.de
7
+ Requires-Python: >=3.11
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Requires-Dist: funcnodes
12
+ Description-Content-Type: text/markdown
13
+
14
+ # funcnodes_react_flow
15
+
@@ -0,0 +1,25 @@
1
+ funcnodes_react_flow/__init__.py,sha256=2QVgNFTGYAKxPS8-22H60LLBgSPpmxbnAEjAIRLBkDw,1657
2
+ funcnodes_react_flow/__main__.py,sha256=TevoXm3nT_TkL1RYgAKo5_zefWJhZH4hH3r_MntBz7k,912
3
+ funcnodes_react_flow/android-chrome-192x192.png,sha256=h4hbdDXDtvScWqUT58h4E7HHUgdfqqGQq_M_O9cjS0c,21618
4
+ funcnodes_react_flow/android-chrome-512x512.png,sha256=DrT8R6pyDlXCY8s3xK7XoI7kA9B_tauSHDvAEOGuhhs,109112
5
+ funcnodes_react_flow/apple-touch-icon.png,sha256=eFhCNPRIaVm5byHgky0qyd3Qm26bqVCKoNmYTDkf3K4,19738
6
+ funcnodes_react_flow/asset-manifest.json,sha256=OyWboBO20GB-kn07e4rMSDd1d6744Px6oomS98f82Ik,965
7
+ funcnodes_react_flow/css/style.css,sha256=QQ4BNQ84oP-D5FRhgqPnfajY_oa1xv8cQKMO8JWQoCQ,31856
8
+ funcnodes_react_flow/favicon-16x16.png,sha256=Y6YE3ZUFODMTX-isM-40-TWZfK4-qJPBk1w_KcNwiSo,483
9
+ funcnodes_react_flow/favicon-32x32.png,sha256=WdE9uZZjcQu0EQIHarS1RJeXv-dEB6eHE7WS8X_c-1w,1289
10
+ funcnodes_react_flow/favicon.ico,sha256=Pk8lVbI7hfFz5QXYE2KdTUe1ZYUGWab0AvmUEmkoENw,15406
11
+ funcnodes_react_flow/index.html,sha256=YHIVeG9iBmcdLIi7XIkmbPogCC5Yz5bixu2ZojJq2b0,658
12
+ funcnodes_react_flow/js/830.js,sha256=Up3fVX5PKUFoflJaQInArDTS2koph6c35ZwZZtaKkys,146451
13
+ funcnodes_react_flow/js/830.js.LICENSE.txt,sha256=e5p1o8nk5I59O2lYb59lVhS16o36RTqkziIaZ9X8TZA,721
14
+ funcnodes_react_flow/js/main.js,sha256=0aBlnmMS0xYTalaMz6QT_qDHvYCWW1TAUcUvEoRwpRA,2125392
15
+ funcnodes_react_flow/js/main.js.LICENSE.txt,sha256=Muy20mLKV5ackzmSSaw1Q8bT2jcQGiRoD331JUb3q1E,89306
16
+ funcnodes_react_flow/logo.png,sha256=VPvWfSSqRW-Jv7qiVsE6dxcyaB2vJp1JL60x6IA8Sbk,96855
17
+ funcnodes_react_flow/logo192.png,sha256=XAIrH5_B6T77mW4eEP2emYcTkprrwuokSWKoy27v6uU,19826
18
+ funcnodes_react_flow/logo512.png,sha256=9SEEPsgJusj_-fxvDf11ea2YpUKXOdLhSPT3DNRw9e8,65653
19
+ funcnodes_react_flow/manifest.json,sha256=ULPYw5A68_eNhxuUVXqxT045yhkurKPSz6hjyGcnmhQ,492
20
+ funcnodes_react_flow/robots.txt,sha256=kNJLw79pisHhc3OVAimMzKcq3x9WT6sF9IS4xI0crdI,67
21
+ funcnodes_react_flow/run.py,sha256=8hLzKI0eIRwHMDfhg_uA_raRnA9XukB5-k_Bpdr__0M,2989
22
+ funcnodes_react_flow-0.1.5.dist-info/METADATA,sha256=bjduSbFOI6U6qTrfXTqLmQEdPJHUIAMnFfBLQONu5Nk,433
23
+ funcnodes_react_flow-0.1.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
24
+ funcnodes_react_flow-0.1.5.dist-info/entry_points.txt,sha256=FbrfqRLScFuNXaVpoyfz7lPcSjTlRf4G06ZUZhTgJMM,75
25
+ funcnodes_react_flow-0.1.5.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.9.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ funcnodes_react_flow=funcnodes_react_flow.__main__:main
3
+