python3-cyberfusion-queue-support 1.6__tar.gz → 1.7.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_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/PKG-INFO +1 -1
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/pyproject.toml +1 -1
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/copy.py +22 -8
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/outcomes.py +6 -3
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/python3_cyberfusion_queue_support.egg-info/PKG-INFO +1 -1
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/README.md +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/setup.cfg +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/__init__.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/exceptions/__init__.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/interfaces.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/__init__.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/chmod.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/chown.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/command.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/mkdir.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/move.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/rmtree.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_daemon_reload.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_tmp_files_create.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_unit_disable.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_unit_enable.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_unit_reload.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_unit_restart.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_unit_start.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/systemd_unit_stop.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/items/unlink.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/cyberfusion/QueueSupport/utilities.py +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/python3_cyberfusion_queue_support.egg-info/SOURCES.txt +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/python3_cyberfusion_queue_support.egg-info/dependency_links.txt +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/python3_cyberfusion_queue_support.egg-info/requires.txt +0 -0
- {python3_cyberfusion_queue_support-1.6 → python3_cyberfusion_queue_support-1.7.0}/src/python3_cyberfusion_queue_support.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-queue-support
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary: Library to queue actions.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-queue-support
|
|
@@ -36,22 +36,29 @@ class CopyItem(_Item):
|
|
|
36
36
|
if os.path.islink(self.destination):
|
|
37
37
|
raise PathIsSymlinkError(self.destination)
|
|
38
38
|
|
|
39
|
-
def _get_changed_lines(self) -> List[str]:
|
|
39
|
+
def _get_changed_lines(self) -> Optional[List[str]]:
|
|
40
40
|
"""Get differences with destination file.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Returns None if the changed_lines could not be determined, for example
|
|
43
|
+
if the destination file is encrypted.
|
|
43
44
|
"""
|
|
44
45
|
changed_lines = []
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
destination_contents = []
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
try:
|
|
50
|
+
source_contents = open(self.source).readlines()
|
|
51
|
+
except UnicodeDecodeError:
|
|
52
|
+
return None
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
if os.path.isfile(self.destination):
|
|
55
|
+
try:
|
|
56
|
+
destination_contents = open(self.destination).readlines()
|
|
57
|
+
except UnicodeDecodeError:
|
|
58
|
+
return None
|
|
52
59
|
|
|
53
60
|
for line in difflib.unified_diff(
|
|
54
|
-
|
|
61
|
+
destination_contents,
|
|
55
62
|
source_contents,
|
|
56
63
|
fromfile=self.source,
|
|
57
64
|
tofile=self.destination,
|
|
@@ -69,7 +76,14 @@ class CopyItem(_Item):
|
|
|
69
76
|
|
|
70
77
|
changed_lines = self._get_changed_lines()
|
|
71
78
|
|
|
72
|
-
if not os.path.exists(self.destination)
|
|
79
|
+
if not os.path.exists(self.destination):
|
|
80
|
+
copy = True
|
|
81
|
+
elif changed_lines is None:
|
|
82
|
+
copy = True
|
|
83
|
+
else:
|
|
84
|
+
copy = bool(changed_lines)
|
|
85
|
+
|
|
86
|
+
if copy:
|
|
73
87
|
outcomes.append(
|
|
74
88
|
CopyItemCopyOutcome(
|
|
75
89
|
source=self.source,
|
|
@@ -10,7 +10,7 @@ class CopyItemCopyOutcome(OutcomeInterface):
|
|
|
10
10
|
"""Represents outcome."""
|
|
11
11
|
|
|
12
12
|
def __init__(
|
|
13
|
-
self, *, source: str, destination: str, changed_lines: list[str]
|
|
13
|
+
self, *, source: str, destination: str, changed_lines: Optional[list[str]] = None
|
|
14
14
|
) -> None:
|
|
15
15
|
"""Set attributes."""
|
|
16
16
|
self.source = source
|
|
@@ -19,10 +19,13 @@ class CopyItemCopyOutcome(OutcomeInterface):
|
|
|
19
19
|
|
|
20
20
|
def __str__(self) -> str:
|
|
21
21
|
"""Get human-readable string."""
|
|
22
|
-
|
|
22
|
+
if self.changed_lines:
|
|
23
|
+
changed_lines = "\nChanged lines:\n" + "\n".join(self.changed_lines)
|
|
24
|
+
else:
|
|
25
|
+
changed_lines = ""
|
|
23
26
|
|
|
24
27
|
return (
|
|
25
|
-
f"Copy {self.source} to {self.destination}
|
|
28
|
+
f"Copy {self.source} to {self.destination}.{changed_lines}"
|
|
26
29
|
)
|
|
27
30
|
|
|
28
31
|
def __eq__(self, other: object) -> bool:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-queue-support
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0
|
|
4
4
|
Summary: Library to queue actions.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-queue-support
|
|
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
|