entangled-cli 2.1.2__tar.gz → 2.1.4__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.1.2 → entangled_cli-2.1.4}/PKG-INFO +1 -1
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/filedb.py +4 -4
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/transaction.py +8 -1
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/pyproject.toml +1 -1
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/LICENSE +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/README.md +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/__init__.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/code_reader.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/__init__.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/brei.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/new.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/status.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/stitch.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/sync.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/tangle.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/commands/watch.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/config/__init__.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/config/language.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/config/templates.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/config/version.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/construct.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/document.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/errors/__init__.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/errors/internal.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/errors/user.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/hooks/__init__.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/hooks/base.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/hooks/build.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/hooks/quarto_attributes.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/hooks/shebang.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/hooks/task.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/logging.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/main.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/markdown_reader.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/parsing.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/properties.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/py.typed +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/status.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/tangle.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/text_location.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/utility.py +0 -0
- {entangled_cli-2.1.2 → entangled_cli-2.1.4}/entangled/version.py +0 -0
|
@@ -20,7 +20,7 @@ def hexdigest(s: str) -> str:
|
|
|
20
20
|
"""Creates a MD5 hash digest from a string. Before hashing, the string has
|
|
21
21
|
linefeed `\\r` characters and trailing newlines removed, and the string
|
|
22
22
|
is encoded as UTF-8."""
|
|
23
|
-
content = s.replace("\r", "").rstrip(
|
|
23
|
+
content = s.replace("\r", "").rstrip().encode()
|
|
24
24
|
return hashlib.sha256(content).hexdigest()
|
|
25
25
|
|
|
26
26
|
|
|
@@ -111,9 +111,9 @@ class FileDB:
|
|
|
111
111
|
logging.debug("Writing FileDB")
|
|
112
112
|
raw = {
|
|
113
113
|
"version": __version__,
|
|
114
|
-
"files": [stat.to_json() for stat in self._files.values()],
|
|
115
|
-
"source": list(map(str, self._source)),
|
|
116
|
-
"target": list(map(str, self._target)),
|
|
114
|
+
"files": sorted([stat.to_json() for stat in self._files.values()], key=lambda s: s["path"]),
|
|
115
|
+
"source": list(sorted(map(str, self._source))),
|
|
116
|
+
"target": list(sorted(map(str, self._target))),
|
|
117
117
|
}
|
|
118
118
|
json.dump(raw, open(FileDB.path(), "w"), indent=2, sort_keys=True)
|
|
119
119
|
|
|
@@ -75,6 +75,13 @@ class Create(Action):
|
|
|
75
75
|
return f"create `{self.target}`"
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
def assure_final_newline(str) -> str:
|
|
79
|
+
if str[-1] != "\n":
|
|
80
|
+
return str + "\n"
|
|
81
|
+
else:
|
|
82
|
+
return str
|
|
83
|
+
|
|
84
|
+
|
|
78
85
|
@dataclass
|
|
79
86
|
class Write(Action):
|
|
80
87
|
content: str
|
|
@@ -96,7 +103,7 @@ class Write(Action):
|
|
|
96
103
|
tmp_dir = Path() / ".entangled" / "tmp"
|
|
97
104
|
tmp_dir.mkdir(exist_ok=True, parents=True)
|
|
98
105
|
with tempfile.NamedTemporaryFile(mode="w", delete=False, dir=tmp_dir) as f:
|
|
99
|
-
f.write(self.content)
|
|
106
|
+
f.write(assure_final_newline(self.content))
|
|
100
107
|
# Flush and sync contents to disk
|
|
101
108
|
f.flush()
|
|
102
109
|
if self.mode is not None:
|
|
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
|