class variable '_class_suffixes' can be used for the same purpose as
'_class_prefixes' but match with the suffix of the class name.

Signed-off-by: ISHIDA Wataru <[email protected]>
---
 ryu/lib/stringify.py |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ryu/lib/stringify.py b/ryu/lib/stringify.py
index f6b2dca..1561ca3 100644
--- a/ryu/lib/stringify.py
+++ b/ryu/lib/stringify.py
@@ -105,6 +105,7 @@ class StringifyMixin(object):
     """
 
     _class_prefixes = []
+    _class_suffixes = []
 
     def stringify_attrs(self):
         """an override point for sub classes"""
@@ -133,6 +134,9 @@ class StringifyMixin(object):
         for p in cls._class_prefixes:
             if k.startswith(p):
                 return True
+        for p in cls._class_suffixes:
+            if k.endswith(p):
+                return True
         return False
 
     @classmethod
-- 
1.7.10.4


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to