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

[tor-commits] [bridgedb/master] Move constant ALPHANUMERIC into function isValidRouterNickname().



commit fa1a3f8052beca8312ff8dda30f7acf1581952e8
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Sun Dec 8 00:26:00 2013 +0000

    Move constant ALPHANUMERIC into function isValidRouterNickname().
    
    It isn't used anywhere else, and it would be silly to import it from
    here, so there is no reason to have it at the module level.
---
 lib/bridgedb/parse/networkstatus.py |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/bridgedb/parse/networkstatus.py b/lib/bridgedb/parse/networkstatus.py
index 1683d38..1cb54d3 100644
--- a/lib/bridgedb/parse/networkstatus.py
+++ b/lib/bridgedb/parse/networkstatus.py
@@ -45,14 +45,13 @@ class InvalidRouterNickname(ValueError):
     """Router nickname doesn't follow tor-spec."""
 
 
-ALPHANUMERIC = string.letters + string.digits
-
-
 def isValidRouterNickname(nickname):
     """Determine if a router's given nickname meets the specification.
 
     :param string nickname: An OR's nickname.
     """
+    ALPHANUMERIC = string.letters + string.digits
+
     try:
         if not (1 <= len(nickname) <= 19):
             raise InvalidRouterNickname(



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