Looks good to me.

On Fri, May 24, 2013 at 05:03:26PM +0000, Shaun Crampton wrote:
> From: Shaun Crampton <[email protected]>
> 
> For convenience, make packet into a sequence type.
> 
> Enables accessing protocols with packet[n].
> 
> Signed-off-by: Shaun Crampton <[email protected]>
> 
> ---
>  ryu/lib/packet/packet.py |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/ryu/lib/packet/packet.py b/ryu/lib/packet/packet.py
> index 84e5bf8..2ef08c1 100644
> --- a/ryu/lib/packet/packet.py
> +++ b/ryu/lib/packet/packet.py
> @@ -95,3 +95,15 @@ class Packet(object):
>  
>      def __iter__(self):
>          return self
> +
> +    def __getitem__(self, idx):
> +        return self.protocols[idx]
> +
> +    def __setitem__(self, idx, item):
> +        self.protocols[idx] = item
> +
> +    def __delitem__(self, idx):
> +        del self.protocols[idx]
> +
> +    def __len__(self):
> +        return len(self.protocols)
> -- 
> 1.7.9.5
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service 
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

-- 
yamahata

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to