From d6685b49b94af756791c0ea0e87912d64100efbb Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 24 Jan 2018 15:48:56 -0800 Subject: [PATCH] use inspect --- devsupApp/src/devsup/ptable.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devsupApp/src/devsup/ptable.py b/devsupApp/src/devsup/ptable.py index 4cc7127..24e7570 100644 --- a/devsupApp/src/devsup/ptable.py +++ b/devsupApp/src/devsup/ptable.py @@ -3,7 +3,7 @@ import logging LOG = logging.getLogger(__name__) -import threading +import threading, inspect _tables = {} @@ -298,7 +298,7 @@ class TableBase(object): # and place appropriate things in the instance dictionary rparams = {} rgroups = {} - for k,v in self.__class__.__dict__.items(): + for k,v in inspect.getmembers(self): if isinstance(v, Parameter): scan = None if not v.name: @@ -324,7 +324,7 @@ class TableBase(object): P._groups.add(G) # second pass to attach actions - for k,v in self.__class__.__dict__.items(): + for k,v in inspect.getmembers(self): if hasattr(v, '_ptable_action'): for src,cond,cmeth in v._ptable_action: # src is instance parameter or group