kalong 0.8.0__py3-none-any.whl → 0.8.1__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.
kalong/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """A new take on debugging"""
2
2
 
3
- __version__ = "0.8.0"
3
+ __version__ = "0.8.1"
4
4
  import os
5
5
  import sys
6
6
  from pathlib import Path
kalong/config.py CHANGED
@@ -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",
@@ -95,6 +97,11 @@ class Config:
95
97
  type=str,
96
98
  help="Path of the socket into which to feed the url for docker browser opening",
97
99
  )
100
+ parser.add_argument(
101
+ "--version",
102
+ action="version",
103
+ version=f"kalong {__version__}",
104
+ )
98
105
  parser.add_argument(
99
106
  "command",
100
107
  nargs=REMAINDER,
kalong/debugger.py CHANGED
@@ -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
 
kalong/server.py CHANGED
@@ -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
 
@@ -140,7 +146,8 @@ def serve():
140
146
  app["back"] = {}
141
147
  app.on_shutdown.append(shutdown)
142
148
  app.router.add_get(r"/{side:(front|back)}/{origin}", websocket)
143
- app.router.add_static("/assets/", Path(__file__).parent / "static" / "assets")
149
+ assets = Path(__file__).parent / "static" / "assets"
150
+ app.router.add_static("/front/assets/", assets)
144
151
  try:
145
152
  loop = asyncio.get_event_loop()
146
153
  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>