feed(buffer, notempty, s, writelock, close)
multiprocessing.queues.Queue._feed = staticmethod(new_feed)
+import logging
+import logging.config
import multiprocessing
import optparse
import os.path
import unittest
+import StringIO
import sys
from . import engine as engine
default_settings=default_settings)
config.read()
self.config = config
+ self.load_log()
self.load_plugins()
self.load_drivers()
self.load_ui()
self.command = engine.CommandEngine()
-
self.playlists = playlist.NoteIndexList()
+ def load_log(self):
+ config_file = StringIO.StringIO()
+ self.config.write(config_file)
+ logging.config.fileConfig(StringIO.StringIO(config_file.getvalue()))
+ # Don't attach the logger because it contains an unpicklable
+ # thread.lock. Instead, grab it directly every time you need it.
+ #self.log = logging.getLogger('hooke')
+
def load_plugins(self):
self.plugins = plugin_mod.load_graph(
plugin_mod.PLUGIN_GRAPH, self.config, include_section='plugins')
help='Add a command line Hooke command to run.')
options,arguments = p.parse_args()
if len(arguments) > 0:
- print >> sys.stderr, 'Too many arguments to %s: %d > 0' \
- % (sys.argv[0], len(arguments))
- print >> sys.stderr, p.help()
+ print >> sys.stderr, 'More than 0 arguments to %s: %s' \
+ % (sys.argv[0], arguments)
+ p.print_help(sys.stderr)
sys.exit(1)
hooke = Hooke(debug=__debug__)