Number of small changes
This commit is contained in:
parent
534ca0dcea
commit
7838ff2773
@ -1,7 +1,4 @@
|
|||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import tkMessageBox
|
|
||||||
|
|
||||||
from utils.sourceloader import SourceLoader
|
|
||||||
|
|
||||||
class ConfigImporter():
|
class ConfigImporter():
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
@ -34,9 +31,10 @@ class ConfigImporter():
|
|||||||
return 'Name, Weight'
|
return 'Name, Weight'
|
||||||
|
|
||||||
class GUI():
|
class GUI():
|
||||||
def __init__(self, search, config_file='GUI/gui.cfg'):
|
def __init__(self, search, config_file='GUI/gui.cfg', sourceloader = None):
|
||||||
"""Boots the window, configuration."""
|
"""Boots the window, configuration."""
|
||||||
self.configurator = ConfigImporter(config_file)
|
self.configurator = ConfigImporter(config_file)
|
||||||
|
self.sourceloader = sourceloader
|
||||||
self.finish_with_search = False
|
self.finish_with_search = False
|
||||||
self.values = {}
|
self.values = {}
|
||||||
self.required_variables = ['substance']
|
self.required_variables = ['substance']
|
||||||
@ -188,8 +186,7 @@ class GUI():
|
|||||||
'list': False,
|
'list': False,
|
||||||
'search': True}
|
'search': True}
|
||||||
|
|
||||||
source_loader = SourceLoader()
|
self.search(arguments, self.sourceloader)
|
||||||
self.search(arguments, source_loader)
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Starts the window and the search."""
|
"""Starts the window and the search."""
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
from fourmi import search
|
from fourmi import search
|
||||||
from GUI import gui
|
from GUI import gui
|
||||||
|
from utils.sourceloader import SourceLoader
|
||||||
|
|
||||||
gui_window = gui.GUI(search)
|
|
||||||
|
gui_window = gui.GUI(search, sourceloader=SourceLoader())
|
||||||
gui_window.run()
|
gui_window.run()
|
||||||
|
@ -6,7 +6,6 @@ class TestGUI(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def test_empty_attributes(self):
|
def test_empty_attributes(self):
|
||||||
self.test_gui = gui.GUI(None, '../GUI/gui.cfg')
|
self.test_gui = gui.GUI(None, '../GUI/gui.cfg')
|
||||||
self.test_gui.window.after(9, self.test_gui.prepare_search)
|
self.test_gui.window.after(9, self.test_gui.prepare_search)
|
||||||
|
Reference in New Issue
Block a user