Permalink
Browse files

Fix use_global_config and use_env_var for options with unspecified de…

…faults.

Setting up default_conda_prefix in ~/.planemo.yml was not being respected.
  • Loading branch information...
jmchilton committed Jun 16, 2017
1 parent 9636682 commit 475104c9dd5f2b6f9e20cf398c92aeb74c9618ea
Showing with 7 additions and 1 deletion.
  1. +7 −1 planemo/config.py
@@ -74,8 +74,12 @@ def planemo_option(*args, **kwargs):
use_global_config = kwargs.pop("use_global_config", False)
use_env_var = kwargs.pop("use_env_var", False)

if "default" in kwargs:
default_specified = "default" in kwargs
default = None
if default_specified:
default = kwargs.pop("default")

if default_specified or use_global_config or use_env_var:
outer_callback = kwargs.pop("callback", None)

def callback(ctx, param, value):
@@ -92,6 +96,8 @@ def callback(ctx, param, value):
return result

kwargs["callback"] = callback

if default_specified:
kwargs["default"] = None

if use_env_var:

0 comments on commit 475104c

Please sign in to comment.