From 3ea1fd9a0eb14c480b6709fc30a4eada2f1c08d6 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Thu, 3 Jun 2010 14:38:09 +0200 Subject: [PATCH] Add function to merge multiple XML files Signed-off-by: Sven Velt --- nagixsc/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nagixsc/__init__.py b/nagixsc/__init__.py index ba96182..8f11a42 100644 --- a/nagixsc/__init__.py +++ b/nagixsc/__init__.py @@ -383,6 +383,14 @@ def xml_from_dict(checks, encoding='base64'): return xmldoc +def xml_merge(xmldocs): + checks = [] + for xmldoc in xmldocs: + checks.extend(xml_to_dict(xmldoc)) + newxmldoc = xml_from_dict(checks) + return newxmldoc + + def check_mark_outdated(check, now, maxtimediff, markold): timedelta = now - check['timestamp'] if timedelta > maxtimediff: -- 2.30.2