[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] Create method to add new header attrs



commit c5b342d25b989f7bbdd8b22b5e6871dbe4eb735a
Author: juga0 <juga@xxxxxxxxxx>
Date:   Thu Oct 18 21:53:24 2018 +0000

    Create method to add new header attrs
---
 sbws/lib/v3bwfile.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index e33a7ec..83df447 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -229,6 +229,11 @@ class V3BWHeader(object):
     def num_lines(self):
         return len(self.__str__().split(LINE_SEP))
 
+    def add_stats(self, **kwargs):
+        # Using kwargs because attributes might chage.
+        [setattr(self, k, str(v)) for k, v in kwargs.items()
+         if k in STATS_KEYVALUES]
+
 
 class V3BWLine(object):
     """



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits