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

Re: [tor-bugs] #8050 [Stem]: Stem's DescriptorReader should provide an option to provide statuses vs. status entries



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs