kalong 0.8.0__tar.gz → 0.8.2__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.
Files changed (29) hide show
  1. {kalong-0.8.0 → kalong-0.8.2}/PKG-INFO +1 -1
  2. {kalong-0.8.0 → kalong-0.8.2}/kalong/__init__.py +1 -1
  3. {kalong-0.8.0 → kalong-0.8.2}/kalong/config.py +15 -0
  4. {kalong-0.8.0 → kalong-0.8.2}/kalong/debugger.py +5 -2
  5. {kalong-0.8.0 → kalong-0.8.2}/kalong/forking.py +1 -1
  6. {kalong-0.8.0 → kalong-0.8.2}/kalong/server.py +21 -13
  7. kalong-0.8.2/kalong/static/assets/favicon-DBiNgszC.svg +21 -0
  8. kalong-0.8.0/kalong/static/assets/index-BQBgymAp.js → kalong-0.8.2/kalong/static/assets/index-JJdLKGIu.js +33 -33
  9. {kalong-0.8.0 → kalong-0.8.2}/kalong/static/index.html +2 -2
  10. {kalong-0.8.0 → kalong-0.8.2}/kalong/utils/__init__.py +2 -1
  11. {kalong-0.8.0 → kalong-0.8.2}/kalong/websockets.py +8 -6
  12. {kalong-0.8.0 → kalong-0.8.2}/pyproject.toml +5 -1
  13. kalong-0.8.0/kalong/static/assets/favicon-rdSYpj7B.svg +0 -11
  14. {kalong-0.8.0 → kalong-0.8.2}/.gitignore +0 -0
  15. {kalong-0.8.0 → kalong-0.8.2}/LICENSE +0 -0
  16. {kalong-0.8.0 → kalong-0.8.2}/README.md +0 -0
  17. {kalong-0.8.0 → kalong-0.8.2}/kalong/__main__.py +0 -0
  18. {kalong-0.8.0 → kalong-0.8.2}/kalong/communication.py +0 -0
  19. {kalong-0.8.0 → kalong-0.8.2}/kalong/errors.py +0 -0
  20. {kalong-0.8.0 → kalong-0.8.2}/kalong/loops.py +0 -0
  21. {kalong-0.8.0 → kalong-0.8.2}/kalong/static/assets/FiraCode-Bold-DzhvDiv4.woff2 +0 -0
  22. {kalong-0.8.0 → kalong-0.8.2}/kalong/static/assets/FiraCode-Regular-jAL9VymT.woff2 +0 -0
  23. {kalong-0.8.0 → kalong-0.8.2}/kalong/stepping.py +0 -0
  24. {kalong-0.8.0 → kalong-0.8.2}/kalong/tracing.py +0 -0
  25. {kalong-0.8.0 → kalong-0.8.2}/kalong/utils/doc_lookup/__init__.py +0 -0
  26. {kalong-0.8.0 → kalong-0.8.2}/kalong/utils/doc_lookup/lookup.json +0 -0
  27. {kalong-0.8.0 → kalong-0.8.2}/kalong/utils/io.py +0 -0
  28. {kalong-0.8.0 → kalong-0.8.2}/kalong/utils/iterators.py +0 -0
  29. {kalong-0.8.0 → kalong-0.8.2}/kalong/utils/obj.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kalong
3
- Version: 0.8.0
3
+ Version: 0.8.2
4
4
  Summary: A new take on python debugging
5
5
  Author-email: Florian Mounier <paradoxxx.zero@gmail.com>
6
6
  License-Expression: GPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  """A new take on debugging"""
2
2
 
3
- __version__ = "0.8.0"
3
+ __version__ = "0.8.2"
4
4
  import os
5
5
  import sys
6
6
  from pathlib import Path
@@ -2,6 +2,8 @@ import logging
2
2
  import os
3
3
  from argparse import REMAINDER, ArgumentParser
4
4
 
5
+ from . import __version__
6
+
5
7
  defaults = {
6
8
  "server": False,
7
9
  "protocol": "http",
@@ -11,6 +13,7 @@ defaults = {
11
13
  "front_port": 59999,
12
14
  "ws_host": "localhost",
13
15
  "ws_port": 59999,
16
+ "base_path": "/",
14
17
  "log": "warn",
15
18
  "detached": False,
16
19
  "command": [],
@@ -90,11 +93,23 @@ class Config:
90
93
  action="store_true",
91
94
  help="Break at the start of the python file",
92
95
  )
96
+ parser.add_argument(
97
+ "--base-path",
98
+ type=str,
99
+ default=self.base_path,
100
+ help="Base path of the frontend url (for use with a proxy for instance)",
101
+ )
93
102
  parser.add_argument(
94
103
  "--urlsocket",
95
104
  type=str,
105
+ default=self.urlsocket,
96
106
  help="Path of the socket into which to feed the url for docker browser opening",
97
107
  )
108
+ parser.add_argument(
109
+ "--version",
110
+ action="version",
111
+ version=f"kalong {__version__}",
112
+ )
98
113
  parser.add_argument(
99
114
  "command",
100
115
  nargs=REMAINDER,
@@ -318,8 +318,11 @@ def serialize_inspect(key, frame):
318
318
  }
319
319
  ]
320
320
  for frame_ in iter_frame(frame):
321
- if obj in frame_.f_locals.values():
322
- break
321
+ try:
322
+ if obj in frame_.f_locals.values():
323
+ break
324
+ except Exception:
325
+ pass
323
326
  else:
324
327
  frame_ = None
325
328
 
@@ -15,7 +15,7 @@ def forkserver():
15
15
  kalong_dir = Path(__file__).parent.parent
16
16
  env = dict(os.environ)
17
17
  env["PYTHONPATH"] = (
18
- f'{kalong_dir}:{env["PYTHONPATH"]}' if env.get("PYTHONPATH") else kalong_dir
18
+ f"{kalong_dir}:{env['PYTHONPATH']}" if env.get("PYTHONPATH") else kalong_dir
19
19
  )
20
20
 
21
21
  popen_args = (
@@ -9,7 +9,7 @@ from pathlib import Path
9
9
  from aiohttp import WSMsgType, web
10
10
  from aiohttp.web_runner import GracefulExit
11
11
 
12
- from . import config
12
+ from . import __version__, config
13
13
  from .errors import NoClientFoundError
14
14
  from .utils import USER_SIGNAL, basicConfig, human_readable_side, parse_origin
15
15
  from .websockets import websocket_options
@@ -34,17 +34,23 @@ def index():
34
34
  if not index.__content__:
35
35
  with open(Path(__file__).parent / "static" / "index.html", "rb") as f:
36
36
  index.__content__ = f.read()
37
+
38
+ vars = [
39
+ f'window.KALONG_VERSION = "{__version__}"',
40
+ ]
37
41
  if config.ws_port != config.port or config.ws_host != config.host:
38
- index.__content__ = index.__content__.replace(
39
- b"</body>",
40
- f"""
41
- <script>
42
- window.KALONG_WS_HOST = "{config.ws_host}";
43
- window.KALONG_WS_PORT = {config.ws_port};
44
- </script>
45
- </body>
46
- """.encode(),
47
- )
42
+ vars.append(f'window.KALONG_WS_HOST = "{config.ws_host}"')
43
+ vars.append(f"window.KALONG_WS_PORT = {config.ws_port}")
44
+
45
+ index.__content__ = index.__content__.replace(
46
+ b"</body>",
47
+ f"""
48
+ <script>
49
+ {";".join(vars)}
50
+ </script>
51
+ </body>
52
+ """.encode(),
53
+ )
48
54
  return web.Response(body=index.__content__, content_type="text/html")
49
55
 
50
56
 
@@ -139,8 +145,10 @@ def serve():
139
145
  app["front"] = {}
140
146
  app["back"] = {}
141
147
  app.on_shutdown.append(shutdown)
142
- app.router.add_get(r"/{side:(front|back)}/{origin}", websocket)
143
- app.router.add_static("/assets/", Path(__file__).parent / "static" / "assets")
148
+ base_path = f"/{config.base_path.strip('/')}/".replace("//", "/")
149
+ app.router.add_get(base_path + r"{side:(front|back)}/{origin}", websocket)
150
+ assets = Path(__file__).parent / "static" / "assets"
151
+ app.router.add_static(base_path + "front/assets/", assets)
144
152
  try:
145
153
  loop = asyncio.get_event_loop()
146
154
  except RuntimeError:
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ width="512"
4
+ height="512"
5
+ viewBox="0 0 512 512"
6
+ version="1.1"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ xmlns:svg="http://www.w3.org/2000/svg">
9
+ <text
10
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:682.667px;line-height:1.25;font-family:'sans-serif';fill:#43a047;fill-opacity:1;stroke:none"
11
+ x="-500.39465"
12
+ y="981.78027"
13
+ transform="matrix(0,-1,-1,0,0,0)">
14
+ <tspan
15
+ x="-500.39465"
16
+ y="-12.287644"
17
+ >
18
+ K
19
+ </tspan>
20
+ </text>
21
+ </svg>