+def read_config(options, directory):
+ """Parse a configuration config.ini from directory and merge it into
+ the options dictionary"""
+ config = configparser.ConfigParser()
+ config.read(os.path.join(directory, "settings.ini"))
+ if config.has_section("config"):
+ for key, value in config.items("config"):
+ options.setdefault("--%s" % key, value)
+