Browse Source

Merge branch 'master' into viewmodel

pull/150/head
chriskiehl 9 years ago
parent
commit
53fe260a19
4 changed files with 7 additions and 11 deletions
  1. 6
      gooey/gui/util/quoting.py
  2. 1
      gooey/gui/widgets/components.py
  3. 7
      gooey/gui/windows/layouts.py
  4. 4
      gooey/python_bindings/config_generator.py

6
gooey/gui/util/quoting.py

@ -1,6 +1,4 @@
import re
import sys
import re
if sys.platform.startswith("win"):
@ -9,7 +7,3 @@ if sys.platform.startswith("win"):
else: # POSIX shell
def quote(value):
return "'{}'".format('{}'.format(value).replace("'", "'\\''"))
def maybe_quote(string):
return '"{}"'.format(string) if not re.match(r'^".*"$', string) else string

1
gooey/gui/widgets/components.py

@ -243,6 +243,7 @@ DirChooser = lambda data: BaseGuiComponent(data=data, widget_pack=widget_
FileSaver = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.FileSaverPayload())
DateChooser = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DateChooserPayload())
TextField = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.TextInputPayload())
CommandField = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.TextInputPayload(no_quoting=True))
Dropdown = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DropdownPayload())
Counter = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.CounterPayload())
MultiDirChooser = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.MultiDirChooserPayload())

7
gooey/gui/windows/layouts.py

@ -10,17 +10,18 @@ from gooey.gui.util.quoting import quote
basic_config = {
'required': [{
'type': 'TextField',
'widgets': [{
'type': 'CommandField',
'required': True,
'data': {
'display_name': 'Enter Commands',
'help': 'Enter command line arguments',
'nargs': '',
'commands': '',
'choices': [],
'default': None,
}
}],
'optional': []
}

4
gooey/python_bindings/config_generator.py

@ -19,12 +19,12 @@ def create_from_parser(parser, source_path, **kwargs):
'program_name': kwargs.get('program_name') or os.path.basename(sys.argv[0]).replace('.py', ''),
'program_description': kwargs.get('program_description', ''),
'show_config': show_config,
'show_advanced': kwargs.get('show_advanced', True),
'show_advanced': kwargs.get('advanced', True),
'default_size': kwargs.get('default_size', (610, 530)),
'num_required_cols': kwargs.get('required_cols', 1),
'num_optional_cols': kwargs.get('optional_cols', 3),
'manual_start': False,
'layout_type': 'column',
'layout_type': 'flat',
'monospace_display': kwargs.get('monospace_display', False),
'image_dir': kwargs.get('image_dir'),
'language_dir': kwargs.get('language_dir'),

Loading…
Cancel
Save