From 69eb6679cac0ede212f8e6204227136e30d785d5 Mon Sep 17 00:00:00 2001
From: Guillaume Valadon <guillaume@valadon.net>
Date: Fri, 22 Jan 2016 14:05:21 +0100
Subject: [PATCH] Adding some comments

---
 scapy/plist.py | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/scapy/plist.py b/scapy/plist.py
index 21410d0c..4ef71da0 100644
--- a/scapy/plist.py
+++ b/scapy/plist.py
@@ -136,12 +136,20 @@ lfilter: truth function to apply to each packet to decide whether it will be dis
 
     def plot(self, f, lfilter=None, **kargs):
         """Applies a function to each packet to get a value that will be plotted
-        with matplotlib. A list of matplotlib.lines.Line2D is returned
-        lfilter: a truth function that decides whether a packet must be ploted"""
+        with matplotlib. A list of matplotlib.lines.Line2D is returned.
+
+        lfilter: a truth function that decides whether a packet must be ploted
+        """
+
+        # Get the list of packets
         l = self.res
+
+        # Apply the filter
         if lfilter is not None:
             l = filter(lfilter, l)
-        l = map(f,l)
+
+        # Apply the function f to the packets
+        l = map(f, l)
 
         # Mimic the default gnuplot output
         if kargs == {}:
@@ -156,11 +164,20 @@ lfilter: truth function to apply to each packet to decide whether it will be dis
 
     def diffplot(self, f, delay=1, lfilter=None, **kargs):
         """diffplot(f, delay=1, lfilter=None)
-        Applies a function to couples (l[i],l[i+delay])"""
+        Applies a function to couples (l[i],l[i+delay])
+
+        A list of matplotlib.lines.Line2D is returned.
+        """
+
+        # Get the list of packets
         l = self.res
+
+        # Apply the filter
         if lfilter is not None:
             l = filter(lfilter, l)
-        l = map(f,l[:-delay],l[delay:])
+
+        # Apply the function f to compute the difference
+        l = map(f, l[:-delay],l[delay:])
 
         # Mimic the default gnuplot output
         if kargs == {}:
-- 
GitLab