else:
buffer.append(line)
- for output_name, output in config.items():
- if "off" in output.options:
+ for output_name in list(config.keys()):
+ if "off" in config[output_name].options:
del config[output_name]
profiles[profile] = config
if load_profile in ( x[0] for x in virtual_profiles ):
profile = generate_virtual_profile(config, modes, load_profile)
else:
- profile = profiles[load_profile]
+ try:
+ profile = profiles[load_profile]
+ except KeyError:
+ print("Failed to load profile '%s':\nProfile not found" % load_profile, file=sys.stderr)
+ sys.exit(1)
add_unused_outputs(config, profile)
if profile == config and not "-f" in options and not "--force" in options:
print("Config already loaded")