Archived
1
0

The path to the config should be absolute by default

This commit is contained in:
Jip J. Dekker 2014-06-17 21:48:37 +02:00
parent 65f39b11ba
commit 934c668c01
2 changed files with 5 additions and 2 deletions

View File

@ -31,8 +31,11 @@ class ConfigImporter():
return 'Name, Weight'
class GUI():
def __init__(self, search, config_file='GUI/gui.cfg', sourceloader = None):
def __init__(self, search, config_file='GUI/gui.cfg', sourceloader = None, in_source=True):
"""Boots the window, configuration."""
if in_source:
current_dir = os.path.dirname(os.path.abspath(__file__))
config_file = current_dir + '/' + config_file
self.configurator = ConfigImporter(config_file)
self.sourceloader = sourceloader
self.finish_with_search = False

View File

@ -7,7 +7,7 @@ class TestGUI(unittest.TestCase):
pass
def test_empty_attributes(self):
self.test_gui = gui.GUI(None, '../GUI/gui.cfg.sample')
self.test_gui = gui.GUI(None, '../GUI/gui.cfg.sample', in_source=False)
self.test_gui.window.after(9, self.test_gui.prepare_search)
self.test_gui.window.after(11, self.test_gui.window.destroy)
self.test_gui.run()