added processes option to command line and config file
Also the config file parser now just looks for all Settings objects in settingsDefinitions.py, not the items in __all__
This commit is contained in:
@@ -27,9 +27,10 @@ class MultiWorldParser(object):
|
||||
# This maps setting names to their values as given in
|
||||
# settingsDefinition.py
|
||||
self._settings = {}
|
||||
for settingname in settingsDefinition.__all__:
|
||||
for settingname in dir(settingsDefinition):
|
||||
setting = getattr(settingsDefinition, settingname)
|
||||
assert isinstance(setting, settingsValidators.Setting)
|
||||
if not isinstance(setting, settingsValidators.Setting):
|
||||
continue
|
||||
|
||||
self._settings[settingname] = setting
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import multiprocessing.managers
|
||||
import cPickle as pickle
|
||||
import Queue
|
||||
import time
|
||||
import logging
|
||||
|
||||
from signals import Signal
|
||||
|
||||
|
||||
@@ -45,11 +45,6 @@
|
||||
|
||||
from settingsValidators import *
|
||||
|
||||
# This is the export list for this module. It defines which items defined in
|
||||
# this module are recognized by the config parser. Don't forget to update this
|
||||
# if you add new items!
|
||||
__all__ = ['render', 'world', 'outputdir']
|
||||
|
||||
# render is a dictionary mapping strings to dicts. These dicts describe the
|
||||
# configuration for that render. Therefore, the validator for 'render' is set
|
||||
# to a dict validator configured to validate keys as strings and values as...
|
||||
@@ -87,3 +82,4 @@ world = Setting(required=True, validator=make_dictValidator(validateStr, validat
|
||||
|
||||
outputdir = Setting(required=True, validator=validateOutputDir, default=None)
|
||||
|
||||
processes = Setting(required=True, validator=int, default=-1)
|
||||
|
||||
Reference in New Issue
Block a user