dialoghelper 0.0.15__tar.gz → 0.0.16__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.

Potentially problematic release.


This version of dialoghelper might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dialoghelper
3
- Version: 0.0.15
3
+ Version: 0.0.16
4
4
  Summary: Helper functions for solveit dialogs
5
5
  Home-page: https://github.com/AnswerDotAI/dialoghelper
6
6
  Author: Jeremy Howard
@@ -18,7 +18,7 @@ Classifier: License :: OSI Approved :: Apache Software License
18
18
  Requires-Python: >=3.9
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
- Requires-Dist: fastcore
21
+ Requires-Dist: fastcore>=1.8.5
22
22
  Requires-Dist: fastlite
23
23
  Requires-Dist: ghapi
24
24
  Requires-Dist: ipykernel-helper
@@ -0,0 +1,2 @@
1
+ __version__ = "0.0.16"
2
+ from .core import *
@@ -8,6 +8,7 @@ d = { 'settings': { 'branch': 'main',
8
8
  'syms': { 'dialoghelper.core': { 'dialoghelper.core._add_msg_unsafe': ('core.html#_add_msg_unsafe', 'dialoghelper/core.py'),
9
9
  'dialoghelper.core._msg': ('core.html#_msg', 'dialoghelper/core.py'),
10
10
  'dialoghelper.core._umsg': ('core.html#_umsg', 'dialoghelper/core.py'),
11
+ 'dialoghelper.core.add_html': ('core.html#add_html', 'dialoghelper/core.py'),
11
12
  'dialoghelper.core.add_msg': ('core.html#add_msg', 'dialoghelper/core.py'),
12
13
  'dialoghelper.core.del_msg': ('core.html#del_msg', 'dialoghelper/core.py'),
13
14
  'dialoghelper.core.export_dialog': ('core.html#export_dialog', 'dialoghelper/core.py'),
@@ -2,8 +2,8 @@
2
2
 
3
3
  # %% auto 0
4
4
  __all__ = ['Placements', 'empty', 'get_db', 'find_var', 'find_dialog_id', 'find_msgs', 'find_msg_id', 'read_msg_ids', 'msg_idx',
5
- 'read_msg', 'del_msg', 'add_msg', 'update_msg', 'load_gist', 'gist_file', 'import_string', 'is_usable_tool',
6
- 'mk_toollist', 'import_gist', 'export_dialog', 'import_dialog', 'tool_info', 'asdict']
5
+ 'read_msg', 'add_html', 'del_msg', 'add_msg', 'update_msg', 'load_gist', 'gist_file', 'import_string',
6
+ 'is_usable_tool', 'mk_toollist', 'import_gist', 'export_dialog', 'import_dialog', 'tool_info', 'asdict']
7
7
 
8
8
  # %% ../nbs/00_core.ipynb
9
9
  import json, importlib, linecache
@@ -11,6 +11,7 @@ from typing import Dict
11
11
  from tempfile import TemporaryDirectory
12
12
  from ipykernel_helper import *
13
13
  from dataclasses import dataclass
14
+ from fastcore.xml import to_xml
14
15
 
15
16
  from fastcore.utils import *
16
17
  from fastcore.meta import delegates
@@ -98,6 +99,14 @@ def read_msg(n:int=-1, # Message index (if relative, +ve is downwards)
98
99
  db = get_db()
99
100
  return db.t.message.selectone('sid=?', [ids[idx]])
100
101
 
102
+ # %% ../nbs/00_core.ipynb
103
+ def add_html(
104
+ content:str, # The HTML to send to the client (generally should include hx-swap-oob)
105
+ ):
106
+ "Send HTML to the browser to be swapped into the DOM"
107
+ res = to_xml(content)
108
+ xpost('http://localhost:5001/add_html_', data=dict(content=res))
109
+
101
110
  # %% ../nbs/00_core.ipynb
102
111
  def del_msg(
103
112
  sid:str=None, # sid (stable id -- pk) of message that placement is relative to (if None, uses current message)
@@ -280,6 +289,7 @@ def import_dialog(fname, add_header=True):
280
289
  def tool_info():
281
290
  cts='''Tools available from `dialoghelper`:
282
291
 
292
+ - &`add_html`: Send HTML to the browser to be swapped into the DOM using hx-swap-oob.
283
293
  - &`find_dialog_id`: Get the current dialog id.
284
294
  - &`find_msg_id`: Get the current message id.
285
295
  - &`find_msgs`: Find messages in current specific dialog that contain the given information.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dialoghelper
3
- Version: 0.0.15
3
+ Version: 0.0.16
4
4
  Summary: Helper functions for solveit dialogs
5
5
  Home-page: https://github.com/AnswerDotAI/dialoghelper
6
6
  Author: Jeremy Howard
@@ -18,7 +18,7 @@ Classifier: License :: OSI Approved :: Apache Software License
18
18
  Requires-Python: >=3.9
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
- Requires-Dist: fastcore
21
+ Requires-Dist: fastcore>=1.8.5
22
22
  Requires-Dist: fastlite
23
23
  Requires-Dist: ghapi
24
24
  Requires-Dist: ipykernel-helper
@@ -1,4 +1,4 @@
1
- fastcore
1
+ fastcore>=1.8.5
2
2
  fastlite
3
3
  ghapi
4
4
  ipykernel-helper
@@ -1,11 +1,11 @@
1
1
  [DEFAULT]
2
2
  repo = dialoghelper
3
3
  lib_name = dialoghelper
4
- version = 0.0.15
4
+ version = 0.0.16
5
5
  min_python = 3.9
6
6
  license = apache2
7
7
  black_formatting = False
8
- requirements = fastcore fastlite ghapi ipykernel-helper
8
+ requirements = fastcore>=1.8.5 fastlite ghapi ipykernel-helper
9
9
  doc_path = _docs
10
10
  lib_path = dialoghelper
11
11
  nbs_path = nbs
@@ -1,2 +0,0 @@
1
- __version__ = "0.0.15"
2
- from .core import *
File without changes
File without changes
File without changes
File without changes
File without changes