Browse Source

Fixed a bug in base_window where None was being passed as a param when ArgumentParser.description was empty

pull/47/head
chriskiehl 10 years ago
parent
commit
7c81848eff
2 changed files with 28 additions and 2 deletions
  1. 5
      gooey/gui/base_window.py
  2. 25
      gooey/mockapplications/qwindelzorf _example.py

5
gooey/gui/base_window.py

@ -60,9 +60,10 @@ class BaseWindow(wx.Frame):
def _init_components(self, BodyPanel): def _init_components(self, BodyPanel):
# init gui # init gui
_desc = self._client_app.description
self.head_panel = header.FrameHeader( self.head_panel = header.FrameHeader(
heading=i18n.translate("settings_title"), heading=i18n.translate("settings_title"),
subheading=self._client_app.description,
subheading=_desc if _desc is not None else '',
parent=self) parent=self)
self.config_panel = BodyPanel(self) self.config_panel = BodyPanel(self)
self.runtime_display = RuntimeDisplay(self) self.runtime_display = RuntimeDisplay(self)
@ -107,4 +108,4 @@ class BaseWindow(wx.Frame):
if __name__ == '__main__': if __name__ == '__main__':
pass
pass

25
gooey/mockapplications/qwindelzorf _example.py

@ -0,0 +1,25 @@
import argparse
from gooey import Gooey
@Gooey
def main():
parser = argparse.ArgumentParser('Get my users')
parser.add_argument('-type', "--type", type=str, action='store', dest='type', help= "type Query")
parser.add_argument('-dst', "--datestart", type=str, action='store', dest='date_start', help= "from Date")
parser.add_argument('-dsp', "--datestop", type=str, action='store', dest='date_stop', help= "to Date")
parser.add_argument('-n',"--IDuser", type=str, action='store', dest='idu', help="IDuser")
parser.add_argument('-t',"--text", type=str, action='store', dest='text', help="find Text")
parser.add_argument('-f',"--file", type=str, action='store', dest='filepath', help="File Save")
args = parser.parse_args()
query_type = args.type
date_start=args.date_start
date_stop=args.date_stop
userid=args.idu
input_data = args.text
path_to_file = args.filepath
print path_to_file
if __name__ == '__main__':
main()
Loading…
Cancel
Save