(self, remaining, conf_dict)
return argdict
Parse presets
Parse presets
Parse presets
def _parse_presets(self, remaining, conf_dict):
        """Parse presets"""
        presets = DEFAULT_SECTION
        try:
            argdict = {u'preset': remaining.pop(u'preset')}
        except KeyError:
            argdict = {}
        # apply default presets, including nested presets
        while True:
            # get dictionary of default config
            for p in presets:
                try:
                    self._merge_arguments(argdict, conf_dict[p])
                except KeyError:
                    if p not in DEFAULT_SECTION:
                        logging.warning(u'Ignored undefined preset `%s`', p)
            # look for more presets in expended arglist
            try:
                presets = self._to_list(u'preset', argdict.pop(u'preset'))
            except KeyError:
                break
        return argdict
def _parse_presets ( self , remaining , conf_dict ) : presets = DEFAULT_SECTION try : argdict = { u'preset' : remaining . pop ( u'preset' ) } except KeyError : argdict = { } # apply default presets, including nested presets while True : # get dictionary of default config for p in presets : try : self . _merge_arguments ( argdict , conf_dict [ p ] ) except KeyError : if p not in DEFAULT_SECTION : logging . warning ( u'Ignored undefined preset `%s`' , p ) # look for more presets in expended arglist try : presets = self . _to_list ( u'preset' , argdict . pop ( u'preset' ) ) except KeyError : break return argdict