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

24 Oct
2018
24 Oct
'18
9:40 a.m.
commit c5b342d25b989f7bbdd8b22b5e6871dbe4eb735a Author: juga0 <juga@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): """
2427
Age (days ago)
2427
Last active (days ago)
0 comments
1 participants
participants (1)
-
juga@torproject.org