From e0b04e48028708b3bd1ea8c85bb0824599ec9584 Mon Sep 17 00:00:00 2001 From: "Merlijn van Deen (valhallasw)" Date: Mon, 26 Sep 2011 10:41:41 +0200 Subject: [PATCH] Allow subfolders to be reached as attributes --- igor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/igor.py b/igor.py index 16704be..dde1562 100644 --- a/igor.py +++ b/igor.py @@ -289,6 +289,11 @@ class Folder(object): def append(self, record): self.children.append(record) + try: + setattr(self, record.name, record) + except AttributeError: + pass + def format(self, indent=0): parent = u" "*indent+self.name children = [r.format(indent=indent+2) for r in self.children] -- 2.26.2