funcnodes-react-flow 0.3.7__py3-none-any.whl → 0.3.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.
@@ -1,5 +1,9 @@
1
1
  from typing import Dict, TypedDict, List
2
- from .run import run_server # noqa: F401
2
+
3
+ try:
4
+ from .run import run_server # noqa: F401
5
+ except ImportError:
6
+ pass
3
7
 
4
8
 
5
9
  class ReactPlugin(TypedDict):
@@ -1,11 +1,6 @@
1
- from .run import run_server
2
- import funcnodes as fn
3
1
  import argparse
4
-
5
- try:
6
- from setproctitle import setproctitle
7
- except ModuleNotFoundError:
8
- setproctitle = print
2
+ import os
3
+ import sys
9
4
 
10
5
 
11
6
  def main():
@@ -19,25 +14,33 @@ def main():
19
14
  >>> main()
20
15
  None
21
16
  """
17
+
22
18
  parser = argparse.ArgumentParser(description="Funcnodes React Cli.")
23
19
 
24
20
  parser.add_argument(
25
21
  "--port",
26
- default=fn.config.CONFIG["frontend"]["port"],
22
+ default=None,
27
23
  help="Port to run the server on",
28
24
  type=int,
29
25
  )
30
26
  parser.add_argument(
31
27
  "--no-browser",
32
- action="store_false",
28
+ action="store_true",
33
29
  help="Open the browser after starting the server",
34
30
  )
35
31
 
36
32
  args = parser.parse_args()
33
+ cmd = sys.executable + " -m funcnodes runserver"
34
+ if args.port:
35
+ cmd += f" --port {args.port}"
36
+ if args.no_browser:
37
+ cmd += " --no-browser"
38
+
39
+ os.system(cmd)
37
40
 
38
- setproctitle("funcnodes_server")
39
- run_server(port=args.port, open_browser=args.no_browser)
40
41
 
42
+ # "@mui/icons-material": "^5.15.18",
43
+ # "@mui/material": "^5.15.18"
41
44
 
42
45
  if __name__ == "__main__":
43
46
  main()
@@ -1,15 +1,17 @@
1
1
  import os
2
- from funcnodes.runner import BaseServer
3
2
 
3
+ try:
4
+ from funcnodes.runner import BaseServer
4
5
 
5
- class FuncnodesreactflowServer(BaseServer):
6
- STATIC_PATH = os.path.join(os.path.dirname(__file__), "static")
7
- STATIC_URL = "/static"
6
+ class FuncnodesreactflowServer(BaseServer):
7
+ STATIC_PATH = os.path.join(os.path.dirname(__file__), "static")
8
+ STATIC_URL = "/static"
8
9
 
9
- async def index(self, request):
10
- request.match_info["filename"] = "index.html"
11
- return await self.serve_static_file(request)
10
+ async def index(self, request):
11
+ request.match_info["filename"] = "index.html"
12
+ return await self.serve_static_file(request)
12
13
 
13
-
14
- def run_server(**kwargs):
15
- return FuncnodesreactflowServer.run_server(**kwargs)
14
+ def run_server(**kwargs):
15
+ return FuncnodesreactflowServer.run_server(**kwargs)
16
+ except (ImportError, ModuleNotFoundError):
17
+ pass