0

make observer a setting, need to update docs

This commit is contained in:
aheadley
2012-03-22 17:32:28 -04:00
parent a7d6ee81bb
commit 863c6b1154
2 changed files with 8 additions and 6 deletions

View File

@@ -397,11 +397,7 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
else:
dispatch = dispatcher.MultiprocessingDispatcher(
local_procs=config['processes'])
if platform.system() == 'Windows' or not sys.stderr.isatty():
obs = observer.LoggingObserver()
else:
obs = observer.ProgressBarObserver()
dispatch.render_all(tilesets, obs)
dispatch.render_all(tilesets, config['observer'])
dispatch.close()
assetMrg.finalize(tilesets)

View File

@@ -45,6 +45,7 @@
from settingsValidators import *
import util
from observer import ProgressBarObserver, LoggingObserver
# renders is a dictionary mapping strings to dicts. These dicts describe the
# configuration for that render. Therefore, the validator for 'renders' is set
@@ -93,3 +94,8 @@ processes = Setting(required=True, validator=int, default=-1)
# memcached is an option, but unless your IO costs are really high, it just
# ends up adding overhead and isn't worth it.
memcached_host = Setting(required=False, validator=str, default=None)
if platform.system() == 'Windows' or not sys.stderr.isatty():
observer = LoggingObserver()
else:
observer = ProgressBarObserver()