From 0739fd0b94ef7e4cf3f5441865a6121c02b8cb3b Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sun, 12 Feb 2017 22:20:32 +0100 Subject: [PATCH] Exclude Boxes classes starting with _ in getAllBoxGenerators() Exclude mix-in classes that are not supposed to be used on their own --- boxes/generators/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boxes/generators/__init__.py b/boxes/generators/__init__.py index 4b81a2c..fcdbf5b 100644 --- a/boxes/generators/__init__.py +++ b/boxes/generators/__init__.py @@ -13,7 +13,8 @@ def getAllBoxGenerators(): for k, v in module.__dict__.items(): if v is boxes.Boxes: continue - if inspect.isclass(v) and issubclass(v, boxes.Boxes): + if (inspect.isclass(v) and issubclass(v, boxes.Boxes) and + v.__name__[0] != '_'): generators[modname + '.' + v.__name__] = v return generators