Browse Source

Cleaned up unused code.

pull/1/head
Chris Kiehl 11 years ago
parent
commit
9743d18b61
12 changed files with 78 additions and 65 deletions
  1. 2
      src/app/dialogs/action_sorter_unittest.py
  2. 5
      src/app/dialogs/advanced_config_unittest.py
  3. 11
      src/app/dialogs/client_runner.py
  4. 26
      src/app/dialogs/component_register_unittest.py
  5. 1
      src/app/dialogs/controller.py
  6. 13
      src/app/dialogs/footer.py
  7. BIN
      src/app/dialogs/footer.pyc
  8. 5
      src/app/dialogs/option_reader.py
  9. 35
      src/app/dialogs/option_reader_unittest.py
  10. 24
      src/app/dialogs/parse_validator.py
  11. BIN
      src/app/images/image_store.pyc
  12. 21
      src/model/gooey.py

2
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)'''

5
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()

11
src/app/dialogs/client_runner.py

@ -1,11 +0,0 @@
'''
Created on Jan 24, 2014
@author: Chris
'''
if __name__ == '__main__':
pass

26
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()

1
src/app/dialogs/controller.py

@ -65,7 +65,6 @@ class Controller(object):
def OnCancelRunButton(self, event):
pass
def RunClientCode(self):
pool = Pool(1)
try:

13
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()

BIN
src/app/dialogs/footer.pyc

5
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

35
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()

24
src/app/dialogs/parse_validator.py

@ -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

BIN
src/app/images/image_store.pyc

21
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!'

Loading…
Cancel
Save