<s> from vint . linting . config . config_source import ConfigSource <EOL> from vint . linting . level import Level <EOL> class ConfigCmdargsSource ( ConfigSource ) : <EOL> def __init__ ( self , env ) : <EOL> self . _config_dict = self . _build_config_dict ( env ) <EOL> def get_config_dict ( self ) : <EOL> return self . _config_dict <EOL> def _build_config_dict ( self , env ) : <EOL> config_dict = { '<STR_LIT>' : { } } <EOL> config_dict = self . _normalize_color ( env , config_dict ) <EOL> config_dict = self . _normalize_json ( env , config_dict ) <EOL> config_dict = self . _normalize_stat ( env , config_dict ) <EOL> config_dict = self . _normalize_verbose ( env , config_dict ) <EOL> config_dict = self . _normalize_severity ( env , config_dict ) <EOL> config_dict = self . _normalize_max_violations ( env , config_dict ) <EOL> config_dict = self . _normalize_format ( env , config_dict ) <EOL> config_dict = self . _normalize_env ( env , config_dict ) <EOL> return config_dict <EOL> def _pass_config_by_key ( self , key , env , config_dict ) : <EOL> env_cmdargs = env [ '<STR_LIT>' ] <EOL> config_dict_cmdargs = config_dict [ '<STR_LIT>' ] <EOL> if key in env_cmdargs and env_cmdargs [ key ] is not None : <EOL> config_dict_cmdargs [ key ] = env_cmdargs [ key ] <EOL> return config_dict <EOL> def _normalize_stat ( self , env , config_dict ) : <EOL> return self . _pass_config_by_key ( '<STR_LIT>' , env , config_dict ) <EOL> def _normalize_json ( self , env , config_dict ) : <EOL> return self . _pass_config_by_key ( '<STR_LIT>' , env , config_dict ) <EOL> def _normalize_color ( self , env , config_dict ) : <EOL> return self . _pass_config_by_key ( '<STR_LIT>' , env , config_dict ) <EOL> def _normalize_verbose ( self , env , config_dict ) : <EOL> return self . _pass_config_by_key ( '<STR_LIT>' , env , config_dict ) <EOL> def _normalize_max_violations ( self , env , config_dict ) : <EOL> return self . _pass_config_by_key ( '<STR_LIT>' , env , config_dict ) <EOL> def _normalize_format ( self , env , config_dict ) : <EOL> return self . _pass_config_by_key ( '<STR_LIT>' , env , config_dict ) <EOL> def _normalize_severity ( self , env , config_dict ) : <EOL> env_cmdargs = env [ '<STR_LIT>' ] <EOL> config_dict_cmdargs = config_dict [ '<STR_LIT>' ] <EOL> if env_cmdargs . get ( '<STR_LIT>' , False ) : <EOL> config_dict_cmdargs [ '<STR_LIT>' ] = Level . STYLE_PROBLEM <EOL> if env_cmdargs . get ( '<STR_LIT>' , False ) : <EOL> config_dict_cmdargs [ '<STR_LIT>' ] = Level . WARNING <EOL> if env_cmdargs . get ( '<STR_LIT:error>' , False ) : <EOL> config_dict_cmdargs [ '<STR_LIT>' ] = Level . ERROR <EOL> return config_dict <EOL> def _normalize_env ( self , env , config_dict ) : <EOL> env_cmdargs = env [ '<STR_LIT>' ] <EOL> config_dict_cmdargs = config_dict [ '<STR_LIT>' ] <EOL> if '<STR_LIT>' in env_cmdargs and env_cmdargs [ '<STR_LIT>' ] == True : <EOL> config_dict_cmdargs [ '<STR_LIT>' ] = { '<STR_LIT>' : True } <EOL> return config_dict </s>
