466
467
468
469
470
471
472
473
474
475
476
477
478
479
|
#
def add_plugin_defaults(conf_options, conf_plugins, meta={}, module=""):
# Option defaults, if not yet defined
for opt in meta.get("config", []):
if "name" in opt and "value" in opt:
if opt["name"] not in conf_options:
conf_options[opt["name"]] = opt["value"] # should typemap "bool" and "int" here
# Initial plugin activation status
if module and module not in conf_plugins:
conf_plugins[module] = meta.get("priority") in ("core", "builtin", "always", "default", "standard")
|
>
>
>
>
>
>
>
|
|
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
|
#
def add_plugin_defaults(conf_options, conf_plugins, meta={}, module=""):
# Option defaults, if not yet defined
for opt in meta.get("config", []):
if "name" in opt and "value" in opt:
if opt["name"] not in conf_options:
# typemap "bool" and "int" here
if opt["type"] in ("bool", "boolean"):
val = bool(opt["value"])
elif opt["type"] in ("int", "integer", "numeric"):
val = int(opt["value"])
else:
val = str(opt["value"])
conf_options[opt["name"]] = val
# Initial plugin activation status
if module and module not in conf_plugins:
conf_plugins[module] = meta.get("priority") in ("core", "builtin", "always", "default", "standard")
|