<commit_before># -*- coding: utf-8 -*-

# Copyright (c) 2018 shmilee

'''
This subpackage provides GUI support for gdpy3, entry points of gui_scripts.
'''

import sys
import argparse

__all__ = ['gui_script']


def gui_script():
    '''Entry point for gdpy3'''
    parser = argparse.ArgumentParser(
        prog='gdpy3-gui',
        description="A tiny application that converts and plots data.",
        add_help=False,
    )
    arggrp = parser.add_argument_group('arguments')
    arggrp.add_argument('casepath', nargs='?', type=str,
                        help='Case data path, support types: '
                        'local or sftp directory, '
                        'tar, zip, npz or hdf5 file.')
    optgrp = parser.add_argument_group('options')
    optgrp.add_argument('--backend', type=str,  default='tk',
                        choices=['tk'],
                        help="Set GUI backend, (default:  %(default)s)")
    optgrp.add_argument('--ask_sftp', action='store_true',
                        help='If no casepath given, first ask a sftp path')
    optgrp.add_argument('-h', '--help', action='store_true',
                        help='Show this help message and exit')

    args = parser.parse_args()

    if args.help:
        parser.print_help()
        sys.exit()

    if args.backend == 'tk':
        from .tk import GTkApp
        GTkApp(path=args.casepath, ask_sftp=args.ask_sftp)<commit_msg>Set AppUserModelID for GUI process in Windows<commit_after># -*- coding: utf-8 -*-

# Copyright (c) 2018 shmilee

'''
This subpackage provides GUI support for gdpy3, entry points of gui_scripts.
'''
import os
import sys
import ctypes
import argparse
from ..__about__ import __version__, __author__

__all__ = ['gui_script']


def gui_script():
    '''Entry point for gdpy3'''
    parser = argparse.ArgumentParser(
        prog='gdpy3-gui',
        description="A tiny application that converts and plots data.",
        add_help=False,
    )
    arggrp = parser.add_argument_group('arguments')
    arggrp.add_argument('casepath', nargs='?', type=str,
                        help='Case data path, support types: '
                        'local or sftp directory, '
                        'tar, zip, npz or hdf5 file.')
    optgrp = parser.add_argument_group('options')
    optgrp.add_argument('--backend', type=str,  default='tk',
                        choices=['tk'],
                        help="Set GUI backend, (default:  %(default)s)")
    optgrp.add_argument('--ask_sftp', action='store_true',
                        help='If no casepath given, first ask a sftp path')
    optgrp.add_argument('-h', '--help', action='store_true',
                        help='Show this help message and exit')

    args = parser.parse_args()

    if args.help:
        parser.print_help()
        sys.exit()

    AppID = '%s.%s.v%s' % (__author__, __name__, __version__)
    if os.name == 'nt':
        # AppUserModelID for Windows7 ... Windows10
        ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(AppID)

    if args.backend == 'tk':
        from .tk import GTkApp
        GTkApp(path=args.casepath, ask_sftp=args.ask_sftp)
{'fraction_non_alphanumeric': 0.12503956948401393, 'fraction_numerical': 0.0072807850585628366, 'mean_word_length': 2.3652822151224706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6301754', 'n_tokens_mistral': 989, 'n_tokens_neox': 945, 'n_words': 243}