[diffoscope] 02/06: config: adds parallel flag
Juliana Oliveira
jwnx-guest at moszumanska.debian.org
Tue Jan 23 22:03:35 CET 2018
This is an automated email from the git hooks/post-receive script.
jwnx-guest pushed a commit to branch jwnx_parallel_diffoscope
in repository diffoscope.
commit 5dbe4d585b72d9e7105173c7dc47c4ee6dd44baa
Author: Juliana Oliveira <juliana.orod at gmail.com>
Date: Tue Jan 16 10:36:05 2018 -0200
config: adds parallel flag
This patch adds Config().parallel flag and Config().check_parallel method,
that checks if multiprocess library is present. If it is, sets
Config().parallel to True.
Signed-off-by: Juliana Oliveira <juliana.orod at gmail.com>
---
diffoscope/config.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/diffoscope/config.py b/diffoscope/config.py
index 430844a..790463e 100644
--- a/diffoscope/config.py
+++ b/diffoscope/config.py
@@ -54,7 +54,8 @@ class Config(object):
compute_visual_diffs = False
max_container_depth = 50
force_details = False
- jobs = 2
+ parallel = False
+ jobs = 1
_singleton = {}
@@ -85,3 +86,11 @@ class Config(object):
self.check_ge("max_diff_block_lines", "max_page_diff_block_lines")
self.check_ge("max_report_size", "max_page_size")
self.check_ge("max_report_size", "max_page_size_child")
+
+ def check_parallel(self):
+ import importlib
+ multiprocess = importlib.util.find_spec("multiprocess")
+ dill = importlib.util.find_spec("dill")
+ self.parallel = (multiprocess and dill)
+ return self.parallel
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list