示例#1
0
def parser():
    parser = ArgParser(description='Nest Thermostat Flask')

    parser.add_argument('--use_hostname',
                        '-u',
                        action='store_true',
                        help='Use hostname instead of localhost/127.0.0.1')
    parser.add_argument('--port',
                        '-p',
                        type=int,
                        default=10000,
                        help='Port to use')

    parser.add_common_arg('--config',
                          '-c',
                          metavar='PATH',
                          default=DEFAULT_CONFIG_PATH,
                          help='Config file location')
    parser.add_common_arg(
        '--reauth',
        '-A',
        action='store_true',
        help='Force re-authentication, even if a cached session exists')
    parser.include_common_args('verbosity')
    return parser
示例#2
0
def parser():
    parser = ArgParser(
        description=
        'Utility to check passwords against the list from haveibeenpwned.com')
    parser.add_argument(
        '--pw_list_path',
        '-p',
        metavar='PATH',
        default=LIST_PATH,
        help=
        'Path to the file that contains the hashed password list (default: %(default)s)'
    )

    src_group = parser.add_mutually_exclusive_group()
    src_group.add_argument('--from_file',
                           '-f',
                           metavar='PATH',
                           help='Path to a KeePass csv file to check')
    src_group.add_argument(
        '--non_confidential',
        '-C',
        nargs='+',
        help='One or more non-confidential passwords to test')

    parser.include_common_args('verbosity', 'dry_run')
    return parser
示例#3
0
def parser():
    parser = ArgParser(description='Extract and cleanup album zips')
    parser.add_argument('path', help='Directory to process')
    parser.add_argument('--old_mode',
                        '-o',
                        action='store_true',
                        help='Use the old extraction mode')
    parser.include_common_args('verbosity')
    return parser
示例#4
0
def parser():
    parser = ArgParser(description='Sort TV show episodes')
    parser.add_argument('src_path', help='Source directory')
    parser.add_argument('dst_path', help='Target directory')
    parser.add_argument('--rm', '-r', action='store_true', help='Remove files after copying')
    parser.add_argument('--no-refresh', '-F', dest='refresh', action='store_false', help='Do not check for newly added files in src_path after copying existing files')
    parser.add_argument('--show-dests', '-S', action='store_true', help='Show show destination paths instead of copying any files')
    parser.add_argument('--buf_size', '-b', type=int, help='Copy buffer size (default: usually ~8MB)')
    parser.include_common_args('verbosity', 'dry_run')
    return parser
示例#5
0
def parser():
    parser = ArgParser(
        description='Nier Replicant ver.1.22474487139... Save File Watcher')
    parser.add_argument('--path', '-p', help='Save file path to watch')
    parser.add_argument(
        '--backups',
        '-b',
        metavar='PATH',
        help=
        'Path to the directory in which backups should be saved (default: same dir as save files)'
    )
    parser.include_common_args('verbosity')
    return parser
示例#6
0
def parser():
    parser = ArgParser(description='Merge 2 or more PDFs')
    parser.add_argument(
        'path',
        nargs='+',
        help='Two or more paths of PDF files to merge in the order provided')
    parser.add_argument('--output',
                        '-o',
                        metavar='PATH',
                        help='Output file name',
                        required=True)
    parser.include_common_args('verbosity')
    return parser
示例#7
0
文件: pizza.py 项目: dskrypa/ds_tools
def parser():
    parser = ArgParser(description='Extract and cleanup album zips')
    parser.add_argument('--people',
                        '-p',
                        type=int,
                        default=5,
                        help='Number of people to simulate')
    parser.add_argument('--slices',
                        '-s',
                        type=int,
                        default=8,
                        help='Number of slices per pizza')
    parser.include_common_args('verbosity')
    return parser
示例#8
0
def parser():
    parser = ArgParser(description='File Backup Tool')
    parser.add_argument('source', metavar='PATH', help='The file to backup')
    parser.add_argument('dest_dir',
                        metavar='PATH',
                        help='The directory in which backups should be stored')

    opt_group = parser.add_argument_group('Behavior Options')
    opt_group.add_argument(
        '--always',
        '-a',
        action='store_true',
        help='Always make a backup, even if the source file has not changed')

    parser.include_common_args('verbosity', 'dry_run')
    return parser
def main():
    parser = ArgParser('Lyric Fetcher Flask Server')
    parser.add_argument('--use_hostname',
                        '-u',
                        action='store_true',
                        help='Use hostname instead of localhost/127.0.0.1')
    parser.add_argument('--port',
                        '-p',
                        type=int,
                        default=10000,
                        help='Port to use')
    parser.include_common_args('verbosity')
    args = parser.parse_args()
    init_logging(None, args.verbose or 2)

    host = socket.gethostname() if args.use_hostname else None
    if platform.system() == 'Windows':
        from ds_tools.flasks.socketio_server import SocketIOServer as Server
    else:
        from ds_tools.flasks.gunicorn_server import GunicornServer as Server

    server = Server(app, args.port, host, blueprints=[blueprint])
    server.start_server()
示例#10
0
def parser():
    parser = ArgParser(description='View hex data as unpacked structs')
    parser.add_argument('data', nargs='+', help='A hex string')
    parser.add_argument(
        '--offset',
        '-o',
        type=int,
        default=0,
        help=
        'Offset from the beginning of the data in bytes to start struct matching'
    )
    parser.add_argument('--endian',
                        '-e',
                        choices=('big', 'little', 'native'),
                        help='Interpret values with the given endianness')
    parser.include_common_args('verbosity')
    return parser
示例#11
0
def parser():
    parser = ArgParser(
        description='Download and merge split videos in a M3U8 playlist')

    parser.add_argument(
        'source', help='URL that provides stream info or path to a .m3u8 file')
    parser.add_argument(
        '--name',
        '-n',
        help='The name of the video being downloaded (without extension)',
        required=True)
    parser.add_argument('--save_dir',
                        '-d',
                        default='~/Downloads/m3u8/',
                        help='Directory to store downloads')
    parser.add_argument(
        '--local',
        '-l',
        action='store_true',
        help='Specify if the target ts part files already exist')
    parser.add_argument('--format',
                        '-f',
                        default='mp4',
                        choices=('mp4', 'mkv'),
                        help='Video format (default: %(default)s)')
    parser.add_argument('--goplay',
                        '-g',
                        action='store_true',
                        help='The info url is a goplay.anontpp.com dl code')
    parser.add_argument(
        '--ffmpeg_dl',
        '-F',
        action='store_true',
        help=
        'Have ffmpeg process the m3u8 and download the video parts instead (slower & more error prone)'
    )

    parser.add_common_arg('--debug',
                          '-D',
                          action='store_true',
                          help='Enable HTTP debugging')
    parser.include_common_args('verbosity', parallel=4)
    return parser
示例#12
0
def parser():
    parser = ArgParser(description='UEXP Audio Converter')
    parser.add_argument('path',
                        nargs='+',
                        help='Path to the .uexp file to convert')
    parser.add_argument(
        '--output',
        '-o',
        metavar='PATH',
        help='Output directory (default: same as input directory)')
    parser.add_argument(
        '--wav_output',
        '-w',
        metavar='PATH',
        help='WAV output directory (default: same as input directory)')
    parser.add_argument(
        '--flac_output',
        '-f',
        metavar='PATH',
        help='FLAC output directory (default: same as input directory)')
    parser.add_argument(
        '--mp3_output',
        '-m',
        metavar='PATH',
        help='MP3 output directory (default: same as input directory)')
    parser.add_argument('--mp3',
                        '-M',
                        action='store_true',
                        help='Convert to MP3 in addition to FLAC')
    parser.include_common_args('verbosity')
    return parser
示例#13
0
def parser():
    # fmt: off
    parser = ArgParser(description='Compare images')
    parser.add_argument('path_a', help='Path to an image file')
    parser.add_argument('path_b', help='Path to an image file')
    parser.add_argument(
        '--no_gray',
        '-G',
        dest='gray',
        action='store_false',
        help='Do not normalize images to grayscale before comparisons')
    parser.add_argument(
        '--no_normalize',
        '-N',
        dest='normalize',
        action='store_false',
        help=
        'Do not normalize images for exposure differences before comparisons')
    parser.add_argument(
        '--max_width',
        '-W',
        type=int,
        help='Resize images that have a width greater than this value')
    parser.add_argument(
        '--max_height',
        '-H',
        type=int,
        help='Resize images that have a height greater than this value')
    parser.add_argument('--compare_as',
                        '-c',
                        choices=('jpeg', 'png'),
                        default='jpeg',
                        help='The image format to use for the comparison')
    parser.add_argument(
        '--same',
        '-s',
        action='store_true',
        help='Include comparisons intended for images that are the same')
    parser.include_common_args('verbosity')
    # fmt: on
    return parser
示例#14
0
def parser():
    parser = ArgParser(description='EXIF Sorter')
    parser.add_argument('source', help='Path of the directory to sort from')
    parser.add_argument('target', help='Path of the directory to sort to')
    parser.include_common_args('verbosity', 'dry_run')
    return parser
示例#15
0
def parser():
    parser = ArgParser(description='Sort TV show parts')
    parser.add_argument('path', help='Directory to process')
    parser.include_common_args('verbosity')
    return parser
示例#16
0
def parser():
    parser = ArgParser(description='Tool for testing ANSI colors')
    parser.add_argument(
        '--text',
        '-t',
        help=
        'Text to be displayed (default: the number of the color being shown)')

    parser.add_argument(
        '--color',
        '-c',
        help='Text color to use (default: cycle through 0-256)')
    parser.add_argument('--background',
                        '-b',
                        help='Background color to use (default: None)')
    parser.add_argument('--attr',
                        '-a',
                        choices=ATTRS,
                        help='Background color to use (default: None)')

    parser.add_argument(
        '--all',
        '-A',
        action='store_true',
        help=
        'Show all forground and background colors (only when no color/background is specified)'
    )
    parser.add_argument('--limit',
                        '-L',
                        type=int,
                        default=256,
                        help='Range limit')

    mparser = parser.add_mutually_exclusive_group()
    mparser.add_argument(
        '--basic',
        '-B',
        action='store_true',
        help=
        'Display colors without the 38;5; prefix (cannot be combined with other args)'
    )
    mparser.add_argument(
        '--hex',
        '-H',
        action='store_true',
        help='Display colors by hex value (cannot be combined with other args)'
    )

    return parser