From 0552d040ac8fb4517d77f3fa86ec3039ab71fb4b Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 6 Jun 2021 17:13:42 +0200 Subject: Added a json.dumps() helper that wraps JSON cls. Also tweaked the logic for the size creation so that they don't overlap --- archinstall/lib/general.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/general.py') diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index f72311c9..6bb3b101 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -44,6 +44,8 @@ def locate_binary(name): raise RequirementError(f"Binary {name} does not exist.") +def json_dumps(*args, **kwargs): + return json.dumps(*args, **{**kwargs, 'cls': JSON}) class JsonEncoder: def _encode(obj): @@ -86,7 +88,6 @@ class JSON(json.JSONEncoder, json.JSONDecoder): def encode(self, obj): return super(JSON, self).encode(self._encode(obj)) - class SysCommandWorker: def __init__(self, cmd, callbacks=None, peak_output=False, environment_vars=None, logfile=None, working_directory='./'): if not callbacks: -- cgit v1.2.3-70-g09d2