From b71d22b0edee7ad57c82274db5e22f17e235bca6 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Tue, 17 Jun 2014 21:42:40 +0200 Subject: [PATCH 1/4] This config file is just a sample --- GUI/{gui.cfg => gui.cfg.sample} | 0 tests/test_gui.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename GUI/{gui.cfg => gui.cfg.sample} (100%) diff --git a/GUI/gui.cfg b/GUI/gui.cfg.sample similarity index 100% rename from GUI/gui.cfg rename to GUI/gui.cfg.sample diff --git a/tests/test_gui.py b/tests/test_gui.py index 02d0025..cdd903b 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -7,7 +7,7 @@ class TestGUI(unittest.TestCase): pass def test_empty_attributes(self): - self.test_gui = gui.GUI(None, '../GUI/gui.cfg') + self.test_gui = gui.GUI(None, '../GUI/gui.cfg.sample') 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() From 8ded75d966ed1e1747f5895dc63ae396effcaed0 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Tue, 17 Jun 2014 21:43:53 +0200 Subject: [PATCH 2/4] Ignore gui config file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 14c4e72..509379f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ #may contain authentication information sources.cfg +#Another of our config files +GUI/gui.cfg #THINGS WE WOULD NEVER EVER WANT! #ignore thumbnails created by windows From 65f39b11ba0f6d82dcd29b339a900b8bf9603c46 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Tue, 17 Jun 2014 21:44:58 +0200 Subject: [PATCH 3/4] Add the GUI folder in converage --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e7cd484..d01fbbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: # command to run tests, e.g. python setup.py test script: - - nosetests --with-coverage --cover-package=FourmiCrawler,utils tests + - nosetests --with-coverage --cover-package=FourmiCrawler,utils,GUI tests notifications: slack: descartes2:6sgCzx3PvrO9IIMwKxj12dDM From 934c668c010b21b01db3b1fa9aac26b04971379a Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Tue, 17 Jun 2014 21:48:37 +0200 Subject: [PATCH 4/4] The path to the config should be absolute by default --- GUI/gui.py | 5 ++++- tests/test_gui.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index f020fb3..466ef98 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -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 diff --git a/tests/test_gui.py b/tests/test_gui.py index cdd903b..cfb47b3 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -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()