From 17ce11e5304ddd3a9971a0839cc39244740b5201 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Sat, 21 Jun 2014 00:59:54 +0200 Subject: [PATCH] Create the GUI configuration if not yet existent --- GUI/gui.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GUI/gui.py b/GUI/gui.py index 509d74f..cd02e52 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -1,5 +1,6 @@ from Tkinter import * import os +import shutil from tkFileDialog import asksaveasfilename from configImporter import * @@ -11,6 +12,12 @@ class GUI(): if not in_source: current_dir = os.path.dirname(os.path.abspath(__file__)) config_file = current_dir + '../' + config_file + if not os.path.isfile(config_file): + try: + shutil.copyfile(os.path.dirname(os.path.abspath(__file__)) + "/../GUI.cfg.sample", config_file) + except IOError: + print "GUI configuration couldn't be found and couldn't be created." + sys.exit() self.configurator = ConfigImporter(config_file) self.sourceloader = sourceloader self.finish_with_search = False