Is this needed for of-wire stringification? If no, please use inheritance and move the common code under lib.
Is it necessary for STR_CONVERT to be public? If possible, please make it private. i.e. prepend '_' prefix. thanks, On Thu, Jun 13, 2013 at 05:35:40PM +0900, watanabe.fumitaka wrote: > Signed-off-by: WATANABE Fumitaka <[email protected]> > --- > ryu/ofproto/ofproto_parser.py | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/ryu/ofproto/ofproto_parser.py b/ryu/ofproto/ofproto_parser.py > index 73a6d9e..86c00d0 100644 > --- a/ryu/ofproto/ofproto_parser.py > +++ b/ryu/ofproto/ofproto_parser.py > @@ -62,6 +62,9 @@ def create_list_of_base_attributes(f): > > > class StringifyMixin(object): > + > + STR_CONVERT = {} > + > def __str__(self): > buf = '' > sep = '' > @@ -172,6 +175,8 @@ def ofp_attrs(msg_): > continue > if hasattr(msg_.__class__, k): > continue > + if k in msg_.STR_CONVERT: > + v = msg_.STR_CONVERT[k](v) > yield (k, v) > > > -- 1.7.10.4 > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Ryu-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ryu-devel > -- yamahata ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
