Commits

Marius Gedminas  committed b7dba62

Accept colors from local config too.

Makes this work:

[filter-app:logview]
egg = Dozer#logview
logview.sqlalchemy = #faa

(Previously you had to put the color config into [DEFAULT], if I understand
things correctly.)

  • Participants
  • Parent commits 8d87c91

Comments (0)

Files changed (1)

File dozer/logview.py

 import os
 import re
 import time
+import itertools
 
 from mako.lookup import TemplateLookup
 from paste import urlparser
         self.app = app
         tmpl_dir = os.path.join(here_dir, 'templates')
         self.mako = TemplateLookup(directories=[tmpl_dir])
-        
+
         self.log_colors = {}
-        for key, val in config.iteritems():
+        for key, val in itertools.chain(config.iteritems(),
+                                        kwargs.iteritems()):
             if key.startswith('logview.'):
                 self.log_colors[key[8:]] = val
-        
+
         reqhandler = RequestHandler()
         reqhandler.setLevel(getattr(logging, loglevel))
         logging.getLogger('').addHandler(reqhandler)