예제 #1
0
파일: test_decorators.py 프로젝트: gnef/hug
 def __init__(self):
     hug.cli()(self.hello_world_method)
예제 #2
0
 def __init__(self):
     hug.cli()(self.hello_world_method)
예제 #3
0
파일: cli.py 프로젝트: appunni-dishq/cruft
        print(
            "SUCCESS: Good work! Project's cruft is up to date and as clean as possible :)."
        )


def _update_output(updated: bool) -> None:
    if not updated:
        print("")
        print("Nothing to do, project's cruft is already up to date!")
    else:
        print("")
        print(
            "Good work! Project's cruft has been updated and is as clean as possible!"
        )


def _link_output(linked: bool) -> None:
    if linked:
        print("")
        print("Project successfully linked to template!")
    else:
        print("")
        print("Project linking failed :(")


cli = hug.cli(api=hug_api)
cli(api.create)
cli.output(_update_output)(api.update)
cli.output(_check_command_output)(api.check)
cli.output(_link_output)(api.link)
예제 #4
0
파일: cli.py 프로젝트: zachvalenta/pdocs
import hug

from pdocs import api, logo

cli = hug.cli(api=hug.API(__name__, doc=logo.ascii_art))
cli(api.as_html)
cli(api.as_markdown)
cli(api.server)
예제 #5
0
 def decorator(f):
     return hug.get(output=output)(hug.cli(output=output)(func))