1- from paths_cli .compiling .tools import custom_eval
2- import importlib
31from collections import namedtuple
42
5- from paths_cli .wizard .helper import Helper
63from paths_cli .compiling .root_compiler import _CategoryCompilerProxy
74from paths_cli .wizard .standard_categories import get_category_info
85
1613 defaults = [None , NO_DEFAULT , False , None ]
1714)
1815
16+
1917class WizardParameter :
2018 """Load a single parameter from the wizard.
2119
@@ -47,7 +45,7 @@ def __init__(self, name, ask, loader, *, helper=None, default=NO_DEFAULT,
4745 self .default = default
4846 self .autohelp = autohelp
4947 if summarize is None :
50- summarize = lambda obj : str ( obj )
48+ summarize = str
5149 self .summarize = summarize
5250
5351 @classmethod
@@ -66,15 +64,17 @@ def from_proxy(cls, proxy, compiler_plugin):
6664 loader = loader_dict [proxy .name ]
6765 if isinstance (loader , _CategoryCompilerProxy ):
6866 # TODO: can this import now be moved to top of file?
69- from paths_cli .wizard .plugin_registration import get_category_wizard
67+ from paths_cli .wizard .plugin_registration import \
68+ get_category_wizard
7069 category = loader .category
7170 dct ['loader' ] = get_category_wizard (category )
7271 dct ['ask' ] = get_category_info (category ).singular
7372 dct ['store_name' ] = get_category_info (category ).storage
74- cls = _ExistingObjectParameter
73+ cls_ = _ExistingObjectParameter
7574 else :
75+ cls_ = cls
7676 dct ['loader' ] = loader
77- return cls (** dct )
77+ return cls_ (** dct )
7878
7979 def __call__ (self , wizard , context ):
8080 """Load the parameter.
@@ -268,7 +268,8 @@ def __call__(self, wizard, context=None):
268268 if n_existing == self .n_required :
269269 # early return in this case (return silently)
270270 return {self .name : self ._get_existing (wizard )}
271- elif n_existing > self .n_required :
271+
272+ if n_existing > self .n_required :
272273 sel = [self ._select_single_existing (wizard )
273274 for _ in range (self .n_required )]
274275 dct = {self .name : sel }
0 commit comments