Esempio n. 1
0
from paramSeeker import ParamSeeker, __version__

seeker = ParamSeeker()

# add usage
seeker.set_usage_desc("seeker [OPTION]... ")
seeker.set_usage_desc('seeker thing')

seeker.set_desc("this is like a demo to tell how to use this package\n" +
                "also, this is my test project, with the name of seek\n" +
                "which is sick to see the source code, but the code is\n" +
                "at your source code dir, and you can visit\n\n" +
                "https://github.com/hellflame/paramSeeker/blob/master/seeker/example.py\n" +
                "reference at http://hellflame.github.io/doc/paramSeeker-doc/")


@seeker.seek('--linux', short='-l', extra={'desc': 'this is a test function', 'single_param': True})
def first(wanted):
    result = '\nthis is the first test method and it has got the argument \n\t`\033[01;31m{}\033[00m`\n'.\
        format(wanted)
    return result


@seeker.seek('--black', short='-b', extra={'desc': 'this is a test function with the param head black'})
def second(wanted):
    result = '\nthis is the second test method and it has got the argument \n\t`\033[01;33m{}\033[00m`\n'.\
        format(wanted)
    return result


@seeker.seek('--tell', short='-t', is_mark=True, extra={'desc': 'I may tell you something'})
Esempio n. 2
0
# coding=utf8
from paramSeeker import ParamSeeker
from printer import Printer
from extras import font_handle, font_check
from os import path

seeker = ParamSeeker()
printer = Printer()

font_list = ['DejaVuSansMono-Bold.ttf',
             'handstd_h.otf',
             'fengyun.ttf',
             'huakangbold.otf',
             'letter.ttf',
             'shuyan.ttf']

font_path = printer.font_location

default = {"text": "HellFlame",
           "Type": "",
           "mode": "text",
           "color": "31",
           "Filter": 14,
           "font": 0,
           "file": '',
           "force": False,
           'init': False}


@seeker.seek(param='--init', short='-i', is_mark=True, extra={'desc': 'download fonts and init program'})
def init_program(wanted):