batchfetch 1.3.1__tar.gz → 1.3.2__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.
- {batchfetch-1.3.1 → batchfetch-1.3.2}/PKG-INFO +1 -1
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch/batchfetch_base.py +16 -13
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch.egg-info/PKG-INFO +1 -1
- {batchfetch-1.3.1 → batchfetch-1.3.2}/setup.py +1 -1
- {batchfetch-1.3.1 → batchfetch-1.3.2}/LICENSE +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/README.md +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch/__init__.py +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch/batchfetch_cli.py +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch/batchfetch_git.py +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch/helpers.py +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch.egg-info/SOURCES.txt +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch.egg-info/dependency_links.txt +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch.egg-info/entry_points.txt +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch.egg-info/requires.txt +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/batchfetch.egg-info/top_level.txt +0 -0
- {batchfetch-1.3.1 → batchfetch-1.3.2}/setup.cfg +0 -0
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
import os
|
|
22
22
|
from copy import deepcopy
|
|
23
23
|
from pathlib import Path
|
|
24
|
-
from typing import Any, Dict
|
|
24
|
+
from typing import Any, Dict, List
|
|
25
25
|
|
|
26
26
|
from schema import Optional, Or, Schema
|
|
27
27
|
|
|
@@ -39,13 +39,12 @@ class DataAlreadyInitialized(Exception):
|
|
|
39
39
|
class TaskBase:
|
|
40
40
|
def __init__(self, data: Dict[str, Any], options: Dict[str, Any]):
|
|
41
41
|
self.global_options_schema: Dict[Any, Any] = {}
|
|
42
|
-
self.global_options_values: Dict[str, Any] =
|
|
42
|
+
self.global_options_values: Dict[str, Any] = options
|
|
43
43
|
|
|
44
44
|
self.task_schema: Dict[Any, Any] = {}
|
|
45
45
|
self.task_default_values: Dict[str, Any] = {}
|
|
46
46
|
|
|
47
47
|
self._item_values = data
|
|
48
|
-
self._item_options = options
|
|
49
48
|
|
|
50
49
|
# Variables
|
|
51
50
|
self.values: Dict[str, Any] = {}
|
|
@@ -59,13 +58,14 @@ class TaskBase:
|
|
|
59
58
|
# Options
|
|
60
59
|
self.options = {}
|
|
61
60
|
self.options.update(deepcopy(self.global_options_values))
|
|
62
|
-
|
|
61
|
+
|
|
63
62
|
schema = Schema(self.global_options_schema)
|
|
64
63
|
schema.validate(self.options)
|
|
65
64
|
|
|
66
65
|
# Data
|
|
67
66
|
self.values = {}
|
|
68
67
|
self.values.update(deepcopy(self.task_default_values))
|
|
68
|
+
self.values.update(deepcopy(self.options))
|
|
69
69
|
self.values.update(deepcopy(self._item_values))
|
|
70
70
|
schema = Schema(self.task_schema)
|
|
71
71
|
schema.validate(self.values)
|
|
@@ -98,6 +98,12 @@ class TaskBatchFetch(TaskBase):
|
|
|
98
98
|
"""Plugin downloader base class."""
|
|
99
99
|
|
|
100
100
|
def __init__(self, data: Dict[str, Any], options: Dict[str, Any]):
|
|
101
|
+
new_options = {"exec_before": [],
|
|
102
|
+
"exec_after": [],
|
|
103
|
+
"ignore_untracked": []}
|
|
104
|
+
new_options.update(options)
|
|
105
|
+
options = new_options
|
|
106
|
+
|
|
101
107
|
super().__init__(data=data, options=options)
|
|
102
108
|
self.indent = 4
|
|
103
109
|
self.indent_spaces = " " * self.indent
|
|
@@ -116,12 +122,9 @@ class TaskBatchFetch(TaskBase):
|
|
|
116
122
|
|
|
117
123
|
Optional("exec_before"): Or([str], str),
|
|
118
124
|
Optional("exec_after"): Or([str], str),
|
|
119
|
-
}
|
|
120
125
|
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
"exec_after": [],
|
|
124
|
-
"ignore_untracked": [],
|
|
126
|
+
# Global options (unused locally)
|
|
127
|
+
Optional("ignore_untracked"): Or([str], str),
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
self.task_default_values: Dict[str, Any] = {
|
|
@@ -151,8 +154,8 @@ class TaskBatchFetch(TaskBase):
|
|
|
151
154
|
return
|
|
152
155
|
|
|
153
156
|
# Global
|
|
154
|
-
cmd = self.
|
|
155
|
-
if "exec_before" in self.
|
|
157
|
+
cmd = self.global_options_values["exec_before"] \
|
|
158
|
+
if "exec_before" in self.global_options_values else None
|
|
156
159
|
if cmd:
|
|
157
160
|
self._local_task_exec(cmd, cwd=str(cwd))
|
|
158
161
|
|
|
@@ -167,8 +170,8 @@ class TaskBatchFetch(TaskBase):
|
|
|
167
170
|
return
|
|
168
171
|
|
|
169
172
|
# Local
|
|
170
|
-
cmd = self.
|
|
171
|
-
if "exec_after" in self.
|
|
173
|
+
cmd = self.global_options_values["exec_after"] \
|
|
174
|
+
if "exec_after" in self.global_options_values else None
|
|
172
175
|
if cmd:
|
|
173
176
|
self._local_task_exec(cmd, cwd=str(cwd))
|
|
174
177
|
|
|
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
|