dialoghelper 0.0.13__py3-none-any.whl → 0.0.14__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.
Potentially problematic release.
This version of dialoghelper might be problematic. Click here for more details.
- dialoghelper/__init__.py +1 -1
- dialoghelper/core.py +5 -5
- {dialoghelper-0.0.13.dist-info → dialoghelper-0.0.14.dist-info}/METADATA +1 -1
- dialoghelper-0.0.14.dist-info/RECORD +10 -0
- dialoghelper-0.0.13.dist-info/RECORD +0 -10
- {dialoghelper-0.0.13.dist-info → dialoghelper-0.0.14.dist-info}/WHEEL +0 -0
- {dialoghelper-0.0.13.dist-info → dialoghelper-0.0.14.dist-info}/entry_points.txt +0 -0
- {dialoghelper-0.0.13.dist-info → dialoghelper-0.0.14.dist-info}/licenses/LICENSE +0 -0
- {dialoghelper-0.0.13.dist-info → dialoghelper-0.0.14.dist-info}/top_level.txt +0 -0
dialoghelper/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.14"
|
|
2
2
|
from .core import *
|
dialoghelper/core.py
CHANGED
|
@@ -57,8 +57,8 @@ def find_msgs(
|
|
|
57
57
|
msg_type:str=None, # optional limit by message type ('code', 'note', or 'prompt')
|
|
58
58
|
limit:int=None, # Optionally limit number of returned items
|
|
59
59
|
include_output:bool=True # Include output in returned dict?
|
|
60
|
-
):
|
|
61
|
-
"Find messages in current specific dialog that contain the given information. To refer to a message found later, use its `sid` field (which is the pk)."
|
|
60
|
+
)->list[dict]:
|
|
61
|
+
"Find `list[dict]` of messages in current specific dialog that contain the given information. To refer to a message found later, use its `sid` field (which is the pk)."
|
|
62
62
|
did = find_dialog_id()
|
|
63
63
|
db = get_db()
|
|
64
64
|
res = db.t.message('did=? AND content LIKE ? ORDER BY mid', [did, f'%{pattern}%'], limit=limit)
|
|
@@ -73,7 +73,7 @@ def find_msg_id():
|
|
|
73
73
|
return find_var('__msg_id')
|
|
74
74
|
|
|
75
75
|
# %% ../nbs/00_core.ipynb
|
|
76
|
-
def read_msg_ids():
|
|
76
|
+
def read_msg_ids()->list[str]:
|
|
77
77
|
"Get all ids in current dialog."
|
|
78
78
|
did = find_dialog_id()
|
|
79
79
|
db = get_db()
|
|
@@ -89,7 +89,7 @@ def msg_idx():
|
|
|
89
89
|
def read_msg(n:int=-1, # Message index (if relative, +ve is downwards)
|
|
90
90
|
relative:bool=True # Is `n` relative to current message (True) or absolute (False)?
|
|
91
91
|
):
|
|
92
|
-
"Get the
|
|
92
|
+
"Get the `Message` object indexed in the current dialog."
|
|
93
93
|
ids,idx = msg_idx()
|
|
94
94
|
if relative:
|
|
95
95
|
idx = idx+n
|
|
@@ -144,7 +144,7 @@ def _add_msg_unsafe(
|
|
|
144
144
|
):
|
|
145
145
|
"""Add/update a message to the queue to show after code execution completes, and optionally run it. Be sure to pass a `sid` (stable id) not a `mid` (which is used only for sorting, and can change).
|
|
146
146
|
*WARNING*--This can execute arbitrary code, so check carefully what you run!--*WARNING"""
|
|
147
|
-
add_msg(content=content, run=run, **kwargs)
|
|
147
|
+
return add_msg(content=content, run=run, **kwargs)
|
|
148
148
|
|
|
149
149
|
# %% ../nbs/00_core.ipynb
|
|
150
150
|
def _umsg(
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
dialoghelper/__init__.py,sha256=z-0Rh9e-quhc6YCgBCQPxO9WBChy0UBbaCcAmIPEqfE,43
|
|
2
|
+
dialoghelper/_modidx.py,sha256=BmhVoIv53snN6JQm_EzJp-bu793QuY7EZg2hKaq5_7E,3013
|
|
3
|
+
dialoghelper/core.py,sha256=suW06DOaGDxVH5cgxbue1Yj9HOJjj1m_fA0zSSR-Ecg,12260
|
|
4
|
+
dialoghelper/db_dc.py,sha256=ieSie_K1HHXACEJVZ0rMkD_uo42GgmMqqKDYrodjhtM,2297
|
|
5
|
+
dialoghelper-0.0.14.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
6
|
+
dialoghelper-0.0.14.dist-info/METADATA,sha256=EMdtA7E4bTfJiNRxabpas8Z1RX0GkyGhJw5fMyaT9tA,2558
|
|
7
|
+
dialoghelper-0.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
dialoghelper-0.0.14.dist-info/entry_points.txt,sha256=wvDeX-XTS_XVjWiiPQe6yVfmyNwy9eCr36ewp9baFIg,46
|
|
9
|
+
dialoghelper-0.0.14.dist-info/top_level.txt,sha256=VXLlkgltFs_q-XB9imt2G64I_-MPm1RnxlpvUWPuLKM,13
|
|
10
|
+
dialoghelper-0.0.14.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
dialoghelper/__init__.py,sha256=7byX0N8qjtMnanYWGgpBm__8aWTi6sy6Thzt4kYvjaQ,43
|
|
2
|
-
dialoghelper/_modidx.py,sha256=BmhVoIv53snN6JQm_EzJp-bu793QuY7EZg2hKaq5_7E,3013
|
|
3
|
-
dialoghelper/core.py,sha256=IOnjRTU8oaJPpzt9sOBSmYGumZuZT0j1QOmBhql9kJY,12205
|
|
4
|
-
dialoghelper/db_dc.py,sha256=ieSie_K1HHXACEJVZ0rMkD_uo42GgmMqqKDYrodjhtM,2297
|
|
5
|
-
dialoghelper-0.0.13.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
6
|
-
dialoghelper-0.0.13.dist-info/METADATA,sha256=GwWpTw4e3hkbKus7m_Ks-5P4YfrwGLvo-t1vo_rmjjo,2558
|
|
7
|
-
dialoghelper-0.0.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
dialoghelper-0.0.13.dist-info/entry_points.txt,sha256=wvDeX-XTS_XVjWiiPQe6yVfmyNwy9eCr36ewp9baFIg,46
|
|
9
|
-
dialoghelper-0.0.13.dist-info/top_level.txt,sha256=VXLlkgltFs_q-XB9imt2G64I_-MPm1RnxlpvUWPuLKM,13
|
|
10
|
-
dialoghelper-0.0.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|