entangled-cli 2.2.0__tar.gz → 2.2.1__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.
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/PKG-INFO +1 -1
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/code_reader.py +1 -1
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/tangle.py +2 -2
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/document.py +6 -6
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/task.py +1 -1
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/pyproject.toml +1 -1
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/.gitignore +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/LICENSE +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/README.md +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/__init__.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/__init__.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/brei.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/new.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/status.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/stitch.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/sync.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/watch.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/__init__.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/language.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/templates.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/version.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/errors/__init__.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/errors/internal.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/errors/user.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/filedb.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/from_str.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/__init__.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/base.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/build.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/quarto_attributes.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/repl.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/shebang.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/spdx_license.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/logging.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/main.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/markdown_reader.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/parsing.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/properties.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/py.typed +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/status.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/tangle.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/text_location.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/transaction.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/utility.py +0 -0
- {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/version.py +0 -0
|
@@ -66,7 +66,7 @@ class CodeReader(mawk.RuleSet):
|
|
|
66
66
|
def on_block_end(self, m: re.Match[str]) -> list[str]:
|
|
67
67
|
if m["indent"] != self.current.indent:
|
|
68
68
|
raise IndentationError(self.location)
|
|
69
|
-
self.refs
|
|
69
|
+
self.refs.get_codeblock(self.current.ref).source = "\n".join(self.current.content)
|
|
70
70
|
_ = self.stack.pop()
|
|
71
71
|
return []
|
|
72
72
|
|
|
@@ -69,8 +69,8 @@ def tangle(*, annotate: str | None = None, force: bool = False, show: bool = Fal
|
|
|
69
69
|
|
|
70
70
|
for tgt in refs.targets:
|
|
71
71
|
result, deps = tangle_ref(refs, tgt, annotation_method)
|
|
72
|
-
|
|
73
|
-
t.write(Path(tgt), result, list(map(Path, deps)),
|
|
72
|
+
mask = next(iter(refs.by_name(tgt))).mode
|
|
73
|
+
t.write(Path(tgt), result, list(map(Path, deps)), mask)
|
|
74
74
|
|
|
75
75
|
for h in hooks:
|
|
76
76
|
h.on_tangle(t, refs)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
from textwrap import indent
|
|
2
|
-
from
|
|
2
|
+
from collections.abc import Iterable
|
|
3
|
+
from typing import override
|
|
3
4
|
from dataclasses import dataclass, field
|
|
4
5
|
from collections import defaultdict
|
|
5
6
|
from functools import singledispatchmethod
|
|
6
|
-
from itertools import chain
|
|
7
7
|
from pathlib import PurePath
|
|
8
8
|
|
|
9
|
-
from .config import Language
|
|
10
|
-
from .properties import Property
|
|
9
|
+
from .config.language import Language
|
|
10
|
+
from .properties import Property
|
|
11
11
|
from .errors.internal import InternalError
|
|
12
12
|
from .text_location import TextLocation
|
|
13
13
|
|
|
@@ -101,7 +101,7 @@ class ReferenceMap:
|
|
|
101
101
|
return self.map[key]
|
|
102
102
|
|
|
103
103
|
@singledispatchmethod
|
|
104
|
-
def __getitem__(self, key):
|
|
104
|
+
def __getitem__(self, key: ReferenceId | str) -> CodeBlock | Iterable[CodeBlock]:
|
|
105
105
|
raise NotImplementedError(f"Invalid key: {type(key)}")
|
|
106
106
|
|
|
107
107
|
@__getitem__.register
|
|
@@ -129,7 +129,7 @@ def content_to_text(r: ReferenceMap, c: Content) -> str:
|
|
|
129
129
|
case ReferenceId(): return r.get_codeblock(c).indented_text
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
def document_to_text(r: ReferenceMap, cs:
|
|
132
|
+
def document_to_text(r: ReferenceMap, cs: Iterable[Content]) -> str:
|
|
133
133
|
"""
|
|
134
134
|
Reconstruct original plain text content from a reference map and
|
|
135
135
|
list of content.
|
|
@@ -44,7 +44,7 @@ class Hook(HookBase):
|
|
|
44
44
|
ref: ReferenceId
|
|
45
45
|
|
|
46
46
|
def to_brei_task(self, refs: ReferenceMap):
|
|
47
|
-
cb = refs
|
|
47
|
+
cb = refs.get_codeblock(self.ref)
|
|
48
48
|
if (path := get_attribute(cb.properties, "file")) is None:
|
|
49
49
|
script, _ = tangle_ref(refs, self.ref.name, AnnotationMethod.NAKED)
|
|
50
50
|
else:
|
|
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
|