Skip to content

Instantly share code, notes, and snippets.

@mattdodge
Last active January 28, 2019 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattdodge/289b1ae5f5ba0903d74d979b9dd20ab7 to your computer and use it in GitHub Desktop.
Save mattdodge/289b1ae5f5ba0903d74d979b9dd20ab7 to your computer and use it in GitHub Desktop.
nio Block for setting status
from nio.block.base import Block
from nio.command import command
@command('set_warning')
@command('set_error')
@command('set_ok')
class StatusBlock(Block):
def set_warning(self):
return {'status': self.set_status('warn')}
def set_ok(self):
return {'status': self.set_status('ok')}
def set_error(self):
return {'status': self.set_status('error')}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment