labnotes 0.0.67__tar.gz → 0.0.68__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.
- {labnotes-0.0.67 → labnotes-0.0.68}/PKG-INFO +1 -1
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/create_app.py +8 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/experiment_notes.py +2 -2
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/note-edit.js +1 -4
- labnotes-0.0.68/src/labnotes/tables/note_text.py +10 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/open_tables.py +1 -1
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/read_file.py +2 -0
- labnotes-0.0.68/src/labnotes/wait_for_note.py +20 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/.gitignore +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/CHANGELOG.md +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/MIGRATIONS.md +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/README.md +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/pyproject.toml +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/__init__.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/asset_url.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/check_counts.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/cli.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/context.md +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/context_guide.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/count_runs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/create_experiment.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/create_note.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/data_html.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/default_config_text.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/default_counts.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/drain_watch.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/experiment_runs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/experiments.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/file_changes.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/format_duration.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/format_value.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/group_runs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/init.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/invocation_started.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/is_positive_int.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/list_experiments.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/list_runs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/load_config.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/load_experiment.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/models.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/modes.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/nests_runs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/note_path.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/notebook_kernel.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/output_html.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/parse_run_view.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/print_rows.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/python_blocks.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/read_config.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/read_path.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/render_markdown.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/__init__.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/describe_event.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/execute_run.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/hold_folder.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/new_param_run_id.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/new_run_id.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/new_stamped_run_id.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/param_args.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/param_grid.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/param_run_name.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/plan_runs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/read_experiment_config.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/run_experiment.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/run_folder.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/run_headless.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/runs_parent.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/shell_command.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/start_experiment.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/stop_then_kill.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/wait_for_group.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/runner/write_run_json.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/save_conflict_copy.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/save_note.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/saved_outputs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/serve_app.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/server.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/sort_href.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/sql_quote.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/experiment.js +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/labnotes.css +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/new-note.js +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/note-editor.js +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/row-link.js +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/run-cell.js +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/static/view-toggle.js +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/summarize_config.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/__init__.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/experiment_rows.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/file_prefix.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/iso_time.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/list_experiment_runs.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/path_glob.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/path_pattern.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/read_experiment.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/read_run.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tables/summarize_experiments.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/templates/base.html +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/templates/editor_imports.html +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/templates/experiment.html +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/templates/index.html +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/templates/note.html +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tui/__init__.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tui/dim.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tui/format_elapsed.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tui/run_app.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tui/run_tui.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/src/labnotes/tui/runs_table.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/testing-conventions.toml +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/tests/integration/conftest.py +0 -0
- {labnotes-0.0.67 → labnotes-0.0.68}/uv.lock +0 -0
|
@@ -36,6 +36,7 @@ from labnotes.save_conflict_copy import save_conflict_copy
|
|
|
36
36
|
from labnotes.save_note import save_note
|
|
37
37
|
from labnotes.saved_outputs import saved_outputs
|
|
38
38
|
from labnotes.tables.open_tables import open_tables
|
|
39
|
+
from labnotes.wait_for_note import wait_for_note
|
|
39
40
|
|
|
40
41
|
HERE = Path(__file__).parent
|
|
41
42
|
templates = Jinja2Templates(directory=HERE / "templates")
|
|
@@ -149,6 +150,13 @@ def create_app(config: LabnotesConfig) -> Starlette:
|
|
|
149
150
|
current = save_note(path, base, content)
|
|
150
151
|
if current is not None:
|
|
151
152
|
return JSONResponse({"content": current}, status_code=409)
|
|
153
|
+
await wait_for_note(
|
|
154
|
+
request.app.state.tables,
|
|
155
|
+
config.root,
|
|
156
|
+
request.path_params["name"],
|
|
157
|
+
request.path_params["note"],
|
|
158
|
+
content,
|
|
159
|
+
)
|
|
152
160
|
return Response(status_code=204)
|
|
153
161
|
|
|
154
162
|
async def post_conflict(request: Request) -> Response:
|
|
@@ -12,13 +12,13 @@ async def experiment_notes(
|
|
|
12
12
|
if note is not None:
|
|
13
13
|
where += f" AND filename = {quote_string(note)}"
|
|
14
14
|
rows = await tables.query(
|
|
15
|
-
f"SELECT filename, path FROM files WHERE {where} ORDER BY filename"
|
|
15
|
+
f"SELECT filename, path, content FROM files WHERE {where} ORDER BY filename"
|
|
16
16
|
)
|
|
17
17
|
return [
|
|
18
18
|
{
|
|
19
19
|
"name": str(row["filename"]),
|
|
20
20
|
"path": str(root / str(row["path"])),
|
|
21
|
-
"content":
|
|
21
|
+
"content": str(row["content"] or ""),
|
|
22
22
|
}
|
|
23
23
|
for row in rows
|
|
24
24
|
]
|
|
@@ -11,10 +11,7 @@ export function attach(note, openNow) {
|
|
|
11
11
|
|
|
12
12
|
editor.then(
|
|
13
13
|
() => prose.classList.add("editable"),
|
|
14
|
-
() => {
|
|
15
|
-
status.textContent = "Editing needs the network: the editor loads from esm.sh.";
|
|
16
|
-
status.hidden = false;
|
|
17
|
-
},
|
|
14
|
+
() => {},
|
|
18
15
|
);
|
|
19
16
|
|
|
20
17
|
const open = async (event) => {
|
|
@@ -2,6 +2,7 @@ from pathlib import Path
|
|
|
2
2
|
|
|
3
3
|
from labnotes.tables.file_prefix import file_prefix
|
|
4
4
|
from labnotes.tables.iso_time import iso_time
|
|
5
|
+
from labnotes.tables.note_text import note_text
|
|
5
6
|
from labnotes.tables.path_pattern import path_pattern
|
|
6
7
|
|
|
7
8
|
|
|
@@ -20,5 +21,6 @@ def read_file(root: Path, template: str, path: str) -> list[dict[str, object]]:
|
|
|
20
21
|
"ctime": iso_time(stat.st_ctime),
|
|
21
22
|
"mtime": iso_time(stat.st_mtime),
|
|
22
23
|
"mtime_ns": stat.st_mtime_ns,
|
|
24
|
+
"content": note_text(Path(path)),
|
|
23
25
|
}
|
|
24
26
|
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from dirsql import DirSQL
|
|
5
|
+
|
|
6
|
+
from labnotes.experiment_notes import experiment_notes
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
async def wait_for_note(
|
|
10
|
+
tables: DirSQL,
|
|
11
|
+
root: Path,
|
|
12
|
+
experiment: str,
|
|
13
|
+
note: str,
|
|
14
|
+
content: str | None = None,
|
|
15
|
+
) -> None:
|
|
16
|
+
for _ in range(40):
|
|
17
|
+
found = await experiment_notes(tables, root, experiment, note)
|
|
18
|
+
if found and (content is None or found[0]["content"] == content):
|
|
19
|
+
return
|
|
20
|
+
await asyncio.sleep(0.05)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|