From bdaaf61ab5998fd872248397a31d75e3e10719b8 Mon Sep 17 00:00:00 2001 From: Abdullah Amjad Date: Mon, 30 Sep 2019 10:27:58 +0200 Subject: [PATCH 1/2] added diff to class properties --- dsconfig/output.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dsconfig/output.py b/dsconfig/output.py index a59870b..6504ec8 100644 --- a/dsconfig/output.py +++ b/dsconfig/output.py @@ -337,4 +337,32 @@ def show_actions(data, calls): if lines: print("{}Attribute properties:".format(indent)) print("\n".join(lines)) + + for clss in sorted(changes["classes"]): + info = changes["classes"][clss] + + if info.get("properties"): + lines = [] + for prop, change in sorted(info.get("properties", {}).items()): + if change.get("value"): + value = change.get("value") + old_value = change.get("old_value") + if old_value is not None: + if old_value != value: + # change property + lines.append(yellow("{}= {}".format(indent*2, prop))) + lines.append(property_diff( + change["old_value"], change["value"], indent*3)) + else: + # new property + lines.append(green("{}+ {}".format(indent*2, prop))) + lines.append(green(format_property(change["value"], + indent*3))) + else: + # delete property + lines.append(red("{}- {}".format(indent*2, prop))) + lines.append(red(format_property(change["old_value"], indent*3))) + if lines: + print("{} Class Properties:".format(indent*1)) + print("\n".join(lines)) print From e2be7fc632a97efb60577451ffa5f341b96217f3 Mon Sep 17 00:00:00 2001 From: Abdullah Amjad Date: Mon, 30 Sep 2019 10:30:36 +0200 Subject: [PATCH 2/2] bump version 1.4.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0934e01..1db8887 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( # Package name="python-dsconfig", - version="1.3.1", + version="1.4.0", packages=['dsconfig', 'dsconfig.appending_dict'], description="Library and utilities for Tango device configuration.", # Requirements