[tor-bugs] #8050 [Stem]: Stem's DescriptorReader should provide an option to provide statuses vs. status entries
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Feb 4 05:57:05 UTC 2013
#8050: Stem's DescriptorReader should provide an option to provide statuses vs.
status entries
----------------------------+-----------------------------------------------
Reporter: karsten | Owner: atagar
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Stem | Version:
Resolution: implemented | Keywords:
Parent: | Points:
Actualpoints: |
----------------------------+-----------------------------------------------
Comment(by karsten):
Looks awesome! I'm mostly interested in the ability to use
DescriptorReader with the new document handler. Here's what I did and
what worked just fine:
{{{
from stem.descriptor import DocumentHandler
from stem.descriptor.reader import DescriptorReader
with DescriptorReader('in/consensuses-2013-01/',
document_handler=DocumentHandler.DOCUMENT) as reader:
for document in reader:
print "document version %i, had %i routers" % (
document.version, len(document.routers))
}}}
Thanks!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8050#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list