commit ea3102387729daa17587f12b47f249ff49baf1bd Author: Damian Johnson atagar@torproject.org Date: Tue Sep 18 08:03:12 2012 -0700
Adding bwweightscale parameter constraints
My spec fix to clarify the parameter was merged [1] so enforcing the default and constraints in our parser.
[1] https://trac.torproject.org/6872 --- stem/descriptor/networkstatus.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/stem/descriptor/networkstatus.py b/stem/descriptor/networkstatus.py index 2061bd5..e142728 100644 --- a/stem/descriptor/networkstatus.py +++ b/stem/descriptor/networkstatus.py @@ -87,10 +87,8 @@ FOOTER_STATUS_DOCUMENT_FIELDS = (
ALL_FIELDS = [attr[0] for attr in HEADER_STATUS_DOCUMENT_FIELDS + FOOTER_STATUS_DOCUMENT_FIELDS]
-# Maybe we should add 'bandwidth-weights'? -# https://trac.torproject.org/6872 - DEFAULT_PARAMS = { + "bwweightscale": 10000, "cbtdisabled": 0, "cbtnummodes": 3, "cbtrecentcount": 20, @@ -584,6 +582,8 @@ class NetworkStatusDocument(stem.descriptor.Descriptor): minimum = 1 elif key == "refuseunknownexits": minimum, maximum = 0, 1 + elif key == "bwweightscale": + minimum = 1 elif key == "cbtdisabled": minimum, maximum = 0, 1 elif key == "cbtnummodes":
tor-commits@lists.torproject.org