[tor-bugs] #9277 [BridgeDB]: BridgeDB's handling of config files is non-persistent and uses an old-style class

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jul 29 17:06:24 UTC 2013


#9277: BridgeDB's handling of config files is non-persistent and uses an old-style
class
----------------------+-----------------------------------------------------
 Reporter:  isis      |          Owner:  isis          
     Type:  defect    |         Status:  needs_revision
 Priority:  normal    |      Milestone:                
Component:  BridgeDB  |        Version:                
 Keywords:            |         Parent:                
   Points:            |   Actualpoints:                
----------------------+-----------------------------------------------------
Changes (by cypherpunks):

  * status:  needs_review => needs_revision


Comment:

 On first pass this looks quite good.

 - (9e9ddc56e2f2bd98ff) I think the commits will be more comprehendible if
 each commit message describes what the commit does, instead of describing
 the patchset in the first commit (this may already be on your TODO list,
 though).

 - In Main.py:reconfigure(), can you add the type of `configuration` to the
 docstring?

 - I don't fully understand Conf.load(). I think the method is ok, but it's
 unique. Can you explain why the config file should "not ending with a
 'c'"?
 {{{
 +        elif isinstance(config_file, (ModuleType, self.__class__)):
 +            if ((hasattr(config_file, 'file') is not None) and
 +                not config_file.file.endswith('c')):
 +                    self.file = config_file.file
 }}}

 - Should this use self.file instead of config_file? (config.py:150,
 config.py:157)
 {{{
 +        logging.info("Loading config file: %s" % config_file)
 ...
 +            logging.err(err, "Loading config file '%s' failed!" %
 config_file)
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9277#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list