mirror of https://github.com/chriskiehl/Gooey.git
27 changed files with 84 additions and 378 deletions
Split View
Diff Options
-
18src/app/dialogs/advanced_config_integration_test.py
-
26src/app/dialogs/body.py
-
BINsrc/app/dialogs/body.pyc
-
5src/app/dialogs/component_register.py
-
45src/app/dialogs/controller.py
-
51src/app/dialogs/experiments.py
-
1src/app/dialogs/header.py
-
BINsrc/app/dialogs/header.pyc
-
85src/app/dialogs/model.py
-
21src/app/dialogs/runtime_display_panel.py
-
28src/app/dialogs/segoe_statictext.py
-
55src/app/dialogs/simple_config_panel.py
-
15src/app/dialogs/test.py
-
BINsrc/app/images/alessandro_rei_checkmark.png
-
1src/app/images/image_store.py
-
BINsrc/app/images/image_store.pyc
-
21src/app/testrun.py
-
0src/app/widgets/__init__.py
-
49src/experiments/command.py
-
12src/languages/eng.py
-
6src/languages/english.json
-
1src/mockapplication/mockapp.py
-
8src/model/integration_test.py
-
0src/parser/MultiChoiceOption.py
-
0src/parser/RequiredOption.py
-
0src/parser/__init__.py
-
14src/parser/option.py
@ -1,18 +0,0 @@ |
|||
''' |
|||
Created on Jan 19, 2014 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
import argparse_test_data |
|||
|
|||
|
|||
client_parser_obj = argparse_test_data.parser |
|||
|
|||
frame = MainWindow(client_parser_obj) |
|||
|
|||
|
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
pass |
@ -1,26 +0,0 @@ |
|||
''' |
|||
Created on Dec 23, 2013 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
import wx |
|||
|
|||
class BasicDisplayPanel(wx.Panel): |
|||
def __init__(self, parent, **kwargs): |
|||
wx.Panel.__init__(self, parent, **kwargs) |
|||
|
|||
self.SetBackgroundColour('#F0F0F0') |
|||
|
|||
sizer = wx.BoxSizer(wx.VERTICAL) |
|||
sizer.AddSpacer(10) |
|||
text = wx.StaticText(self, label="Running bla bla bla") |
|||
sizer.Add(text, 0, wx.LEFT, 20) |
|||
sizer.AddSpacer(10) |
|||
|
|||
self.cmd_textbox = wx.TextCtrl( |
|||
self, -1, "", |
|||
style=wx.TE_MULTILINE | wx.TE_READONLY) |
|||
sizer.Add(self.cmd_textbox, 1, wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, 20) |
|||
self.SetSizer(sizer) |
|||
|
@ -1,51 +0,0 @@ |
|||
''' |
|||
Created on Dec 28, 2013 |
|||
|
|||
@author: Chris |
|||
''' |
|||
import os |
|||
import wx |
|||
from wx.lib import scrolledpanel |
|||
from app.dialogs.advanced_config import AdvancedConfigPanel |
|||
|
|||
class MainWindow(wx.Frame): |
|||
|
|||
def __init__(self): |
|||
wx.Frame.__init__( |
|||
self, |
|||
parent=None, |
|||
id=-1, |
|||
title=os.path.basename(__file__), |
|||
size=(640,480) |
|||
) |
|||
|
|||
self._init_components() |
|||
|
|||
def _init_components(self): |
|||
# init components |
|||
self.SetMinSize((400,300)) |
|||
|
|||
panel = AdvancedConfigPanel(self) |
|||
|
|||
sizer = wx.BoxSizer(wx.VERTICAL) |
|||
|
|||
# for i in range(40): |
|||
# t = wx.TextCtrl(panel, -1) |
|||
# sizer.Add(t, 0) |
|||
|
|||
panel.SetSizer(sizer) |
|||
|
|||
_sizer = wx.BoxSizer(wx.VERTICAL) |
|||
_sizer.Add(panel, 1, wx.EXPAND) |
|||
self.SetSizer(_sizer) |
|||
|
|||
def _draw_horizontal_line(self): |
|||
line = wx.StaticLine(self, -1, style=wx.LI_HORIZONTAL) |
|||
line.SetSize((10, 10)) |
|||
self.sizer.Add(line, 0, wx.EXPAND) |
|||
|
|||
if __name__ == '__main__': |
|||
app = wx.App(False) |
|||
frame = MainWindow() |
|||
frame.Show(True) # Show the frame. |
|||
app.MainLoop() |
@ -1,85 +0,0 @@ |
|||
''' |
|||
Created on Jan 23, 2014 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
import sys |
|||
import types |
|||
from app.dialogs.action_sorter import ActionSorter |
|||
|
|||
class ArgumentError(Exception): |
|||
pass |
|||
|
|||
class Model(object): |
|||
_instance = None |
|||
|
|||
def __init__(self, parser=None): |
|||
self._parser = parser |
|||
self.description = parser.description |
|||
|
|||
self.action_groups = ActionSorter(self._parser._actions) |
|||
|
|||
# monkey patch |
|||
print self._parser.error |
|||
self._parser.error = types.MethodType( |
|||
self.ErrorAsString, |
|||
self._parser) |
|||
print self._parser.error |
|||
|
|||
Model._instance = self |
|||
|
|||
def HasPositionals(self): |
|||
if self.action_groups._positionals: |
|||
return True |
|||
return False |
|||
|
|||
def IsValidArgString(self, arg_string): |
|||
if isinstance(self._Parse(arg_string), str): |
|||
return False |
|||
return True |
|||
|
|||
def _Parse(self, arg_string): |
|||
try: |
|||
print self._parser.error |
|||
self._parser.parse_args(arg_string.split()) |
|||
return True |
|||
except ArgumentError as e: |
|||
return str(e) |
|||
|
|||
def GetErrorMsg(self, arg_string): |
|||
return self._FormatMsg(self._Parse(arg_string)) |
|||
|
|||
def _FormatMsg(self, msg): |
|||
output = list(msg) |
|||
if ':' in output: |
|||
output[output.index(':')] = ':\n ' |
|||
return ''.join(output) |
|||
|
|||
def AddToArgv(self, arg_string): |
|||
sys.argv.append(arg_string.split()) |
|||
|
|||
@staticmethod |
|||
def ErrorAsString(self, msg): |
|||
''' |
|||
Monkey patch for parser.error |
|||
Returns the error string rather than |
|||
printing and silently exiting. |
|||
''' |
|||
raise ArgumentError(msg) |
|||
|
|||
@classmethod |
|||
def GetInstance(cls): |
|||
return cls._instance |
|||
|
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
pass |
|||
|
|||
|
|||
# print m2 |
|||
|
|||
|
|||
|
|||
|
@ -1,28 +0,0 @@ |
|||
''' |
|||
Created on Jan 20, 2014 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
import wx |
|||
|
|||
class SegoeText(wx.StaticText): |
|||
''' |
|||
Convenience subclass of wx.StaticText. |
|||
|
|||
Sets the default font to Segoe UI and |
|||
has methods fow easily changing size and weight |
|||
''' |
|||
|
|||
|
|||
def __init__(self, parent, label): |
|||
wx.StaticText.__init__(self, parent, label=label) |
|||
self._font = wx.Font(20, wx.FONTFAMILY_DEFAULT, |
|||
wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False, |
|||
'Segoe UI Light') |
|||
|
|||
self.SetFont(self._font) |
|||
|
|||
def SetWeight(self, weight): |
|||
pass |
|||
|
@ -1,55 +0,0 @@ |
|||
''' |
|||
Created on Dec 9, 2013 |
|||
|
|||
@author: Chris |
|||
|
|||
|
|||
''' |
|||
|
|||
import wx |
|||
import os |
|||
|
|||
class BodyDisplayPanel(wx.Panel): |
|||
def __init__(self, parent, **kwargs): |
|||
wx.Panel.__init__(self, parent, **kwargs) |
|||
|
|||
self.SetBackgroundColour('#F0F0F0') |
|||
|
|||
sizer = wx.BoxSizer(wx.VERTICAL) |
|||
sizer.AddSpacer(10) |
|||
|
|||
# about_header = wx.StaticText(self, label="About") |
|||
# about_header = self._bold_static_text("About") |
|||
# about_body = wx.StaticText(self, label="This program does bla. Enter the command line args of your choice to control bla and bla.") |
|||
# |
|||
# sizer.Add(about_header, 0, wx.LEFT | wx.RIGHT, 20) |
|||
# sizer.AddSpacer(5) |
|||
# sizer.Add(about_body, 0, wx.LEFT | wx.RIGHT, 20) |
|||
|
|||
sizer.AddSpacer(40) |
|||
|
|||
text = self._bold_static_text("Enter Command Line Arguments") |
|||
# |
|||
sizer.Add(text, 0, wx.LEFT, 20) |
|||
sizer.AddSpacer(10) |
|||
|
|||
h_sizer = wx.BoxSizer(wx.HORIZONTAL) |
|||
self.cmd_textbox = wx.TextCtrl( |
|||
self, -1, "") |
|||
h_sizer.Add(self.cmd_textbox, 1, wx.ALL | wx.EXPAND) |
|||
sizer.Add(h_sizer, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, 20) |
|||
|
|||
self.SetSizer(sizer) |
|||
|
|||
def get_contents(self): |
|||
return self.cmd_textbox.GetValue() |
|||
|
|||
def _bold_static_text(self, text_label): |
|||
text = wx.StaticText(self, label=text_label) |
|||
font_size = text.GetFont().GetPointSize() |
|||
bold = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) |
|||
text.SetFont(bold) |
|||
return text |
|||
|
|||
|
|||
|
@ -1,15 +0,0 @@ |
|||
''' |
|||
Created on Dec 8, 2013 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
# im = Image.open(images.computer) |
@ -1,21 +0,0 @@ |
|||
''' |
|||
Created on Dec 8, 2013 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
import wx |
|||
import Queue |
|||
from dialogs.display_main import MainWindow |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
queue = Queue.Queue() |
|||
# stdoutput = sys.stdout |
|||
# out = TestObj(queue) |
|||
# sys.stdout = out |
|||
|
|||
app = wx.App(False) |
|||
frame = MainWindow(queue) |
|||
frame.Show(True) # Show the frame. |
|||
app.MainLoop() |
@ -1,8 +0,0 @@ |
|||
''' |
|||
Created on Jan 24, 2014 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
if __name__ == '__main__': |
|||
pass |
@ -1,14 +0,0 @@ |
|||
''' |
|||
Created on Dec 12, 2013 |
|||
|
|||
@author: Chris |
|||
''' |
|||
|
|||
# parser.add_argument("-r", "--recursive", dest="recurse", action="store_true", help="recurse into subfolders [default: %(default)s]") |
|||
|
|||
class Option(object): |
|||
def __init__(self, arg_option): |
|||
self.arg_option = arg_option |
|||
|
|||
@classmethod |
|||
def |
Write
Preview
Loading…
Cancel
Save