How to use the gooey.GooeyParser function in Gooey

To help you get started, we’ve selected a few Gooey examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pynickle / amazing-python / Gooey / pyinstaller_all / quickpack_gooey.py View on Github external
def pyinstaller_main():
    parser = GooeyParser(
        description="pack your python file")
    parser.add_argument('-p', '--path', required=True,
                        help="Enter the file path you want to pack", widget="DirChooser")
    parser.add_argument(
        '-r',
        '--remove',
        action="store_true",
        help="remove all exe under the path")
    parser.add_argument(
        "-e",
        "--exe",
        action="store_true",
        help="pack py file to exe by pyinstaller")
    args = parser.parse_args()
    file_path = args.path
    remove = args.remove
github Zarxrax / png2srt / PNG2SRT.py View on Github external
def main():
	global REQUEST_CHUNK_SIZE
	global PRIMARY_LANGUAGE
	global AUTH_KEY
	
	#__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
	if getattr(sys, 'frozen', False):
		application_path = sys._MEIPASS
	else:
		application_path = os.path.dirname(os.path.abspath(__file__))
	with open(os.path.join(application_path, 'API_KEY.txt')) as myfile:
		AUTH_KEY=myfile.readline()
	
	parser = GooeyParser(description="Authkey: "+AUTH_KEY)
	parser.add_argument('InputFolder', widget="DirChooser")
	parser.add_argument('-c', '--chunk-size', default=REQUEST_CHUNK_SIZE, type=int, help="If you get errors, reduce to 10 or 5.", dest='chunk')
	parser.add_argument('-l', '--language', choices=['af', 'ar', 'as', 'az', 'be', 'bn', 'bg', 'ca', 'zh', 'hr', 'cs', 'da', 'nl', 'en', 'et', 'fil', 'fi', 'fr', 'de', 'el', 'he', 'hi', 'hu', 'is', 'id', 'it', 'iw', 'ja', 'kk', 'ko', 'ky', 'lv', 'lt', 'mk', 'mr', 'mn', 'ne', 'no', 'ps', 'fa', 'pl', 'pt', 'ro', 'ru', 'sa', 'sr', 'sk', 'sl', 'es', 'sv', 'ta', 'th', 'tl', 'tr', 'uk', 'ur', 'uz', 'vi'], default=PRIMARY_LANGUAGE, help="Select the primary language of the subtitles: \nhttps://cloud.google.com/vision/docs/languages", dest='lang')
	

	args = parser.parse_args()

	input_folder = args.InputFolder
	REQUEST_CHUNK_SIZE = args.chunk
	PRIMARY_LANGUAGE = args.lang
	
	PNG2SRT(input_folder)
github tubiana / TTClust / ttclust / ttclustGUI.py View on Github external
def parseArg():
    parser=GooeyParser()


    
    files = parser.add_argument_group("File")
    files.add_argument("Trajectory File",
                       help="Trajectory file (xtc/trr/dcd/nc/pdb..)",
                       widget="FileChooser")
    files.add_argument("Topology File", help="Topology file (pdb/prmtop..)", widget="FileChooser")
    files.add_argument("-l","--Log File", help="Logfile", widget="FileSaver", default="clustering.log")
    


    selection = parser.add_argument_group("Selection")
    selection.add_argument('-st','--Trajectory Selection', help="selection syntax for trajectory extraction.", default="all")
    selection.add_argument('-sa','--Alignement Selection', help="selection syntax for alignement. use 'none' to remove alignement", default="backbone")
    selection.add_argument('-sr','--Selection for RMSD Calculation', help="selection syntax for RMSD (used for clustering).",  default="backbone")
github chriskiehl / Gooey / gooey / _tmp / mockapp.py View on Github external
def main():
  print 'hello'
  '''
  does stuff with parser.parse_args()
  '''
  desc = "Mock application to test Gooey's functionality"
  file_help_msg = "Name of the file you want to process"
  my_cool_parser = GooeyParser(description=desc)
  my_cool_parser.add_argument("filename", help=file_help_msg, widget="FileChooser")  # positional
  my_cool_parser.add_argument("outfile", help="Name of the file where you'll save the output")  # positional

  my_cool_parser.add_argument('-c', '--countdown', default=2, type=int, help='sets the time to count down from you see its quite simple!')
  # my_cool_parser.add_argument('-c', '--cron-schedule', default=10, type=int, help='Set the datetime when the cron should begin', widget='DateChooser')
  my_cool_parser.add_argument("-s", "--showtime", action="store_true", help="display the countdown timer")
  my_cool_parser.add_argument("-d", "--delay", action="store_true", help="Delay execution for a bit")
  my_cool_parser.add_argument('-v', '--verbose', action='count')
  my_cool_parser.add_argument("-o", "--obfuscate", action="store_true", help="obfuscate the countdown timer!")
  my_cool_parser.add_argument('-r', '--recursive', choices=['yes', 'no'], help='Recurse into subfolders')
  my_cool_parser.add_argument("-w", "--writelog", default="No, NOT whatevs", help="write log to some file or something")
  my_cool_parser.add_argument("-e", "--expandAll", action="store_true", help="expand all processes")
  # verbosity = my_cool_parser.add_mutually_exclusive_group()
  # verbosity.add_argument('-t', '--verbozze', dest='verbose', action="store_true", help="Show more details")
  # verbosity.add_argument('-q', '--quiet', dest='quiet', action="store_true", help="Only output on error")
  print my_cool_parser._actions
github Ambrosys / glyph / glyph / cli / _parser.py View on Github external
def get_parser(parser=None):
    if parser is None:
        parser = Parser()
    if isinstance(parser, Parser):
        parser.add_argument("--gui", action="store_true", default=False)

    gui_active = GUI_AVAILABLE and isinstance(parser, GooeyParser)

    parser.add_argument(
        "--port", type=positive_int, default=5555, help="Port for the zeromq communication (default: 5555)",
    )
    parser.add_argument("--ip", type=str, default="localhost", help="IP of the client (default: localhost)")
    parser.add_argument(
        "--send_meta_data", action="store_true", default=False, help="Send metadata after each generation"
    )
    parser.add_argument(
        "-v",
        "--verbose",
        type=str.upper,
        dest="verbosity",
        choices=["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "NOTSET"],
        default="INFO",
        help="Set logging level",
github chriskiehl / Gooey / gooey / examples / subparser_demo.py View on Github external
def main():
  settings_msg = 'Subparser example demonstating bundled configurations ' \
                 'for Siege, Curl, and FFMPEG'
  parser = GooeyParser(description=settings_msg)
  parser.add_argument('--verbose', help='be verbose', dest='verbose',
                      action='store_true', default=False)
  subs = parser.add_subparsers(help='commands', dest='command')

  curl_parser = subs.add_parser('curl', help='curl is a tool to transfer data from or to a server')
  curl_parser.add_argument('Path',
                           help='URL to the remote server',
                           type=str, widget='FileChooser')
  curl_parser.add_argument('--connect-timeout',
                           help='Maximum time in seconds that you allow curl\'s connection to take')
  curl_parser.add_argument('--user-agent',
                           help='Specify the User-Agent string ')
  curl_parser.add_argument('--cookie',
                           help='Pass the data to the HTTP server as a cookie')
  curl_parser.add_argument('--dump-header', type=argparse.FileType,
                           help='Write the protocol headers to the specified file')
github chriskiehl / Gooey / gooey / _tmp / example_progress_bar_4.py View on Github external
def main():
    parser = GooeyParser(prog="example_progress_bar_1")
    _ = parser.parse_args(sys.argv[1:])

    print("Step 1")

    for i in range(1, 101):
        print("progress: {}%".format(i))
        sys.stdout.flush()
        sleep(0.05)

    print("Step 2")

    print("progress: -1%")  # pulse
    sys.stdout.flush()
    sleep(3)

    print("Step 3")
github josiahseaman / FluentDNA / DDV / fluentdnagui.py View on Github external
def main():
    parser = GooeyParser(usage="%(prog)s [options]",
                                    description="Creates visualizations of FASTA formatted DNA nucleotide data.",
                                    add_help=True,
                                    prog='fluentdna')
    
    if len(sys.argv) == 2 and not sys.argv[1].startswith('-'):  # there's only one input and it does have a flag
        print("--Starting in Quick Mode--")
        print("This will convert the one FASTA file directly to an image and place it in the same "
              "folder as the image for easy access.  "
              # "The scaffolds will be sorted by length for best layout."
              "Recommend you open large files with 'Windows Photo Viewer'.")
        sys.argv[1] = '--fasta=' + sys.argv[1]
        sys.argv.append("--quick")
    if "--quick" in sys.argv:
        sys.argv.append("--no_webpage")  # don't generate a full webpage (deepzoom is time consuming)

        # sys.argv.append("--sort_contigs")
github Ambrosys / glyph / glyph / cli / _parser.py View on Github external
def get_gooey(prog="glyph-remote"):
        probably_fork = "site-packages" not in gooey.__file__
        logger.debug("Gooey located at {}.".format(gooey.__file__))
        if not probably_fork:
            logger.warning("GUI input validators may have no effect")
        parser = GooeyParser(prog=prog)
        return parser