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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -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
- self.options.update(deepcopy(self._item_options))
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
- self.global_options_values: Dict[str, Any] = {
122
- "exec_before": [],
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.options["exec_before"] \
155
- if "exec_before" in self.options else None
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.options["exec_after"] \
171
- if "exec_after" in self.options else None
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -22,7 +22,7 @@ from setuptools import find_packages, setup
22
22
 
23
23
  setup(
24
24
  name="batchfetch",
25
- version="1.3.1",
25
+ version="1.3.2",
26
26
  packages=find_packages(),
27
27
  description="Efficiently clone and pull multiple Git repositories.",
28
28
  license="GPLv3",
File without changes
File without changes
File without changes