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

juga at torproject.org juga at torproject.org
Wed Oct 24 09:40:23 UTC 2018


commit c5b342d25b989f7bbdd8b22b5e6871dbe4eb735a
Author: juga0 <juga at riseup.net>
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):
     """





More information about the tor-commits mailing list