+ if Config.is_ini(config_file):
+ config = Config (config_file)
+ else:
+ # try upgrading from shell config format
+ fp, fn = mkstemp(suffix='sfi_config', text=True)
+ config = Config(fn)
+ # we need to preload the sections we want parsed
+ # from the shell config
+ config.add_section('sfi')
+ config.add_section('sface')
+ config.load(config_file)
+ # back up old config
+ shutil.move(config_file, shell_config_file)
+ # write new config
+ config.save(config_file)
+