[tor-commits] [stem/master] Correcting and expanding summary() example

atagar at torproject.org atagar at torproject.org
Thu Jul 19 16:01:03 UTC 2012


commit 384e78df0594c7d60af4b4a0096b12d4419db7f8
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue Jul 17 07:58:14 2012 -0700

    Correcting and expanding summary() example
    
    The ExitPolicy class no longer has a from_str() function. Also adding an
    example that better exemplifies how ranges work.
---
 stem/exit_policy.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/stem/exit_policy.py b/stem/exit_policy.py
index 07886c3..fca6034 100644
--- a/stem/exit_policy.py
+++ b/stem/exit_policy.py
@@ -148,9 +148,13 @@ class ExitPolicy(object):
     
     ::
     
-      >>> policy = ExitPolicy.from_str("accept *:80, accept *:443, reject *:*")
+      >>> policy = ExitPolicy('accept *:80', 'accept *:443', 'reject *:*')
       >>> policy.summary()
       "accept 80, 443"
+      
+      >>> policy = ExitPolicy('accept *:443', 'reject *:1-1024', 'accept *:*')
+      >>> policy.summary()
+      "reject 1-442, 444-1024"
     
     :returns: str with a concise summary for our policy
     """





More information about the tor-commits mailing list