Fix initial config creation

This commit is contained in:
2026-09-22 10:20:22 +02:00
parent 0adb07d75b
commit ed229ac7c7
+2 -2
View File
@@ -178,7 +178,7 @@ class Frontend:
def on_destroy(self, widget, data=None): def on_destroy(self, widget, data=None):
Gtk.main_quit() Gtk.main_quit()
def create_config(cfgfile): def create_config(cfg, cfgfile):
# create inital config file # create inital config file
with open(cfgfile, 'w') as fh: with open(cfgfile, 'w') as fh:
fh.write('[DB]\n') fh.write('[DB]\n')
@@ -207,7 +207,7 @@ if __name__ == "__main__":
config = configparser.ConfigParser() config = configparser.ConfigParser()
cfgfile = os.path.expanduser(context.cfg['cfgfile']) cfgfile = os.path.expanduser(context.cfg['cfgfile'])
if not config.read(cfgfile): if not config.read(cfgfile):
create_config(cfgfile) create_config(context.cfg, cfgfile)
gtkutils.messagebox( gtkutils.messagebox(
_("Configuration file '{}' not found.\n" _("Configuration file '{}' not found.\n"
"Default configuration has been created.\n" "Default configuration has been created.\n"