From f9c0cb8cab278b127277c42685f277616884a2c1 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sun, 19 Mar 2017 07:34:06 +0100 Subject: [PATCH] Support putting class and instances into UI Groups --- boxes/generators/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boxes/generators/__init__.py b/boxes/generators/__init__.py index 2ccea5f..e6310e8 100644 --- a/boxes/generators/__init__.py +++ b/boxes/generators/__init__.py @@ -17,7 +17,7 @@ class UIGroup: def add(self, box): self.generators.append(box) - self.generators.sort(key=lambda b:b.__class__.__name__) + self.generators.sort(key=lambda b:getattr(b, '__name__', None) or b.__class__.__name__) ui_groups = [ UIGroup("Box", "Boxes"),