diff --git a/src/app/dialogs/action_sorter_unittest.py b/src/app/dialogs/action_sorter_unittest.py index 4f6d5ab..e5ad368 100644 --- a/src/app/dialogs/action_sorter_unittest.py +++ b/src/app/dialogs/action_sorter_unittest.py @@ -17,7 +17,7 @@ class TestActionSorter(unittest.TestCase): def setUp(self): self._actions = argparse_test_data.parser._actions self.sorted_actions = ActionSorter(self._actions) - # pain in the A... PEP8 be damned! + # pain in the A... self.expected_positionals = [ "_StoreAction(option_strings=[], dest='filename', nargs=None, const=None, default=None, type=None, choices=None, help='Name of the file you want to read', metavar=None)", '''_StoreAction(option_strings=[], dest='outfile', nargs=None, const=None, default=None, type=None, choices=None, help="Name of the file where you'll save the output", metavar=None)''' diff --git a/src/app/dialogs/advanced_config_unittest.py b/src/app/dialogs/advanced_config_unittest.py index 63f703b..60a2eee 100644 --- a/src/app/dialogs/advanced_config_unittest.py +++ b/src/app/dialogs/advanced_config_unittest.py @@ -11,6 +11,7 @@ import unittest import advanced_config import argparse_test_data from argparse import ArgumentParser +from config_model import Model class TestAdvancedConfigPanel(unittest.TestCase): @@ -21,8 +22,8 @@ class TestAdvancedConfigPanel(unittest.TestCase): app = wx.PySimpleApp() module_name = os.path.split(sys.argv[0])[-1] frame = wx.Frame(None, -1, module_name, size=(640,480)) - - panel = advanced_config.AdvancedConfigPanel(frame, self.parser) + + panel = advanced_config.AdvancedConfigPanel(frame, Model(self.parser)) frame.Show() app.MainLoop() diff --git a/src/app/dialogs/client_runner.py b/src/app/dialogs/client_runner.py deleted file mode 100644 index e8595a1..0000000 --- a/src/app/dialogs/client_runner.py +++ /dev/null @@ -1,11 +0,0 @@ -''' -Created on Jan 24, 2014 - -@author: Chris -''' - - - - -if __name__ == '__main__': - pass \ No newline at end of file diff --git a/src/app/dialogs/component_register_unittest.py b/src/app/dialogs/component_register_unittest.py new file mode 100644 index 0000000..082821d --- /dev/null +++ b/src/app/dialogs/component_register_unittest.py @@ -0,0 +1,26 @@ +''' +Created on Jan 26, 2014 + +@author: Chris +''' + +import unittest +from component_register import ComponentRegister + +class Test(unittest.TestCase): + + + def setUp(self): + class FakeClass(ComponentRegister): + def __init__(self): + pass + + self.test_class = FakeClass() + + def testHostClassReceivesMixinFunctions(self): + + + +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() \ No newline at end of file diff --git a/src/app/dialogs/controller.py b/src/app/dialogs/controller.py index 8347de4..13108c9 100644 --- a/src/app/dialogs/controller.py +++ b/src/app/dialogs/controller.py @@ -65,7 +65,6 @@ class Controller(object): def OnCancelRunButton(self, event): pass - def RunClientCode(self): pool = Pool(1) try: diff --git a/src/app/dialogs/footer.py b/src/app/dialogs/footer.py index 7ed097b..5b863e6 100644 --- a/src/app/dialogs/footer.py +++ b/src/app/dialogs/footer.py @@ -5,6 +5,7 @@ Created on Dec 23, 2013 ''' import wx +from app.images import image_store class AbstractFooter(wx.Panel): ''' @@ -20,10 +21,20 @@ class AbstractFooter(wx.Panel): self._do_layout() def _init_components(self): + ''' + initialize all of the components used in the footer + TODO: + Add Checkmark image for when the program has finished running. + Refactor image tools into their own module. The resize code is + getting spread around a bit. + ''' self.cancel_button = self._Button('Cancel', wx.ID_CANCEL) self.start_button = self._Button("Start", wx.ID_OK) self.cancel_run_button = self._Button('Cancel', wx.ID_CANCEL) +# _bitmap = wx.Bitmap(image_store.alessandro_rei_checkmark) +# wx.StaticBitmap(self, -1, _bitmap) + def _do_layout(self): v_sizer = wx.BoxSizer(wx.VERTICAL) h_sizer = wx.BoxSizer(wx.HORIZONTAL) @@ -54,7 +65,7 @@ class AbstractFooter(wx.Panel): def NextPage(self): self.cancel_button.Hide() self.start_button.Hide() - self.cancel_run_button.Show() +# self.cancel_run_button.Show() self.Layout() diff --git a/src/app/dialogs/footer.pyc b/src/app/dialogs/footer.pyc index 2f7f22b..a1d73b7 100644 Binary files a/src/app/dialogs/footer.pyc and b/src/app/dialogs/footer.pyc differ diff --git a/src/app/dialogs/option_reader.py b/src/app/dialogs/option_reader.py index 9e38f37..6bcdf20 100644 --- a/src/app/dialogs/option_reader.py +++ b/src/app/dialogs/option_reader.py @@ -13,13 +13,10 @@ class OptionReader(object): ''' __metaclass__ = ABCMeta - def __init__(self): - pass - @abstractmethod def GetOptions(self): ''' Implemented by subclasses. - Defines how the config panels read their options + Defines how the config panel Views retrieve their options ''' pass \ No newline at end of file diff --git a/src/app/dialogs/option_reader_unittest.py b/src/app/dialogs/option_reader_unittest.py new file mode 100644 index 0000000..272d6b6 --- /dev/null +++ b/src/app/dialogs/option_reader_unittest.py @@ -0,0 +1,35 @@ +''' +Created on Jan 26, 2014 + +@author: Chris +''' + +import types +import unittest +from option_reader import OptionReader + + +class FakeClass(OptionReader): + def __init__(self): + pass + +class FakeClassWithImplementation(OptionReader): + def __init__(self): + pass + def GetOptions(self): + pass + + +class Test(unittest.TestCase): + + def test_mixin_classes_throws_typeerror_without_implementation(self): + with self.assertRaises(TypeError): + fake_class = FakeClass() + + def test_mixin_classes_passes_with_implementation(self): + fc = FakeClassWithImplementation() + + +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() \ No newline at end of file diff --git a/src/app/dialogs/parse_validator.py b/src/app/dialogs/parse_validator.py deleted file mode 100644 index 812ff56..0000000 --- a/src/app/dialogs/parse_validator.py +++ /dev/null @@ -1,24 +0,0 @@ -''' -Created on Jan 22, 2014 - -@author: Chris -''' - -import types -from argparse import ArgumentParser - - - - - - - - -def validate(parser, arg_string): - parser.error = types.MethodType(RaiseError, parser) - parser.parse_args(arg_string.split()) - - - -if __name__ == '__main__': - pass \ No newline at end of file diff --git a/src/app/images/image_store.pyc b/src/app/images/image_store.pyc index 82d410a..d0fce9d 100644 Binary files a/src/app/images/image_store.pyc and b/src/app/images/image_store.pyc differ diff --git a/src/model/gooey.py b/src/model/gooey.py index 3c45f89..b0cc931 100644 --- a/src/model/gooey.py +++ b/src/model/gooey.py @@ -25,31 +25,10 @@ def Gooey(f=None, advanced=True, language='english'): Launched ''' -# print locals() - - # Handles if the passed in object is instance - # of ArgumentParser. If so, it's being called as - # a function, rather than a decorator -# if isinstance(f, argparse.ArgumentParser): -# progname = sys.argv[0] -# -# build_doc_from_parser_obj( -# file_name=progname, -# parser_obj=f, -# format=format, -# noob=noob, -# success_msg=success_msg -# ) -# return - - # --------------------------------- # - # Below code is all decorator stuff # - # --------------------------------- # def build(f): def inner(): module_path = get_caller_path() parser = source_parser.extract_parser(module_path) - print 'parser in inner', parser i18n = I18N(language) if not parser: print 'shit fuck!'