File: autoprint.py

package info (click to toggle)
python-invoke 0.11.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,136 kB
  • ctags: 1,702
  • sloc: python: 5,614; makefile: 37; sh: 36
file content (26 lines) | stat: -rw-r--r-- 361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from invoke.tasks import task
from invoke.collection import Collection


@task
def nope():
    return "You can't see this"


@task(autoprint=True)
def yup():
    return "It's alive!"


@task(pre=[yup])
def pre_check():
    pass


@task(post=[yup])
def post_check():
    pass


sub = Collection('sub', yup)
ns = Collection(nope, yup, pre_check, post_check, sub)