From 8c07f1ac4150d3c37888a281f2e6b031a6dc41b0 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 30 Oct 2013 17:07:23 +0100 Subject: [PATCH] Allow the UUID to return a uuid object based on a provided UUID string --- terminatorlib/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terminatorlib/util.py b/terminatorlib/util.py index c9143df2..8cb1b554 100755 --- a/terminatorlib/util.py +++ b/terminatorlib/util.py @@ -277,8 +277,10 @@ def enumerate_descendants(parent): len(terminals), parent)) return(containers, terminals) -def make_uuid(): +def make_uuid(str_uuid=None): """Generate a UUID for an object""" + if str_uuid: + return uuid.UUID(str_uuid) return uuid.uuid4() def inject_uuid(target):