python3-cyberfusion-file-support 1.5__tar.gz → 1.6.0__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.
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/PKG-INFO +1 -1
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/pyproject.toml +1 -1
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/cyberfusion/FileSupport/__init__.py +22 -9
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/python3_cyberfusion_file_support.egg-info/PKG-INFO +1 -1
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/README.md +0 -0
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/setup.cfg +0 -0
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/cyberfusion/FileSupport/encryption.py +0 -0
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/cyberfusion/FileSupport/exceptions.py +0 -0
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/python3_cyberfusion_file_support.egg-info/SOURCES.txt +0 -0
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/python3_cyberfusion_file_support.egg-info/dependency_links.txt +0 -0
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/python3_cyberfusion_file_support.egg-info/requires.txt +0 -0
- {python3_cyberfusion_file_support-1.5 → python3_cyberfusion_file_support-1.6.0}/src/python3_cyberfusion_file_support.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-file-support
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Library for idempotent writing to files.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-file-support
|
|
@@ -123,18 +123,35 @@ class DestinationFileReplacement:
|
|
|
123
123
|
with open(path, open_mode) as f:
|
|
124
124
|
f.write(contents)
|
|
125
125
|
|
|
126
|
+
@property
|
|
127
|
+
def _copy_item(self) -> CopyItem:
|
|
128
|
+
"""Get copy item."""
|
|
129
|
+
return CopyItem(
|
|
130
|
+
source=self.tmp_path,
|
|
131
|
+
destination=self.destination_file.path,
|
|
132
|
+
reference=self.reference,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
@property
|
|
136
|
+
def changed(self) -> bool:
|
|
137
|
+
"""Check if the destination file content has changed."""
|
|
138
|
+
if self.encryption_properties:
|
|
139
|
+
decrypted_contents = self.destination_file.decrypt()
|
|
140
|
+
|
|
141
|
+
return decrypted_contents != self.contents
|
|
142
|
+
|
|
143
|
+
return bool(self._copy_item.outcomes)
|
|
144
|
+
|
|
126
145
|
def add_to_queue(self) -> None:
|
|
127
146
|
"""Add items for replacement to queue."""
|
|
128
147
|
add_copy_item = True
|
|
129
148
|
|
|
130
|
-
decrypted_contents = self.destination_file.decrypt()
|
|
131
|
-
|
|
132
149
|
# If encrypted, only add CopyItem when unencrypted contents changed.
|
|
133
150
|
# CopyItem does not account for encryption, so without this check the
|
|
134
151
|
# file would always be copied.
|
|
135
152
|
|
|
136
|
-
if
|
|
137
|
-
add_copy_item =
|
|
153
|
+
if self.encryption_properties:
|
|
154
|
+
add_copy_item = self.changed
|
|
138
155
|
|
|
139
156
|
# Copy and unlink instead of move. MoveItem copies metadata (which
|
|
140
157
|
# means mode etc. of destination file is incorrect, as set to the tmp
|
|
@@ -143,11 +160,7 @@ class DestinationFileReplacement:
|
|
|
143
160
|
# is unchanged.
|
|
144
161
|
|
|
145
162
|
if add_copy_item:
|
|
146
|
-
copy_item =
|
|
147
|
-
source=self.tmp_path,
|
|
148
|
-
destination=self.destination_file.path,
|
|
149
|
-
reference=self.reference,
|
|
150
|
-
)
|
|
163
|
+
copy_item = self._copy_item
|
|
151
164
|
|
|
152
165
|
self.queue.add(copy_item)
|
|
153
166
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-file-support
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Library for idempotent writing to files.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-file-support
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|