Fix initial config creation
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user