Skip to content

Instantly share code, notes, and snippets.

@saintx
Created December 17, 2013 07:21
Show Gist options
  • Save saintx/8001278 to your computer and use it in GitHub Desktop.
Save saintx/8001278 to your computer and use it in GitHub Desktop.
Example components that extend the Lifecycle base class
from pycocontainer import Pycocontainer, Lifecycle, Stage
class A(Lifecycle):
def __init__(self, b):
super(A, self).__init__()
self.b = b
@Lifecycle.startmethod
def foo(self, *args):
print "Called foo()"
@Lifecycle.stopmethod
def bar(self, *args):
print "Called bar()"
@Lifecycle.failmethod
def baz(self, *args):
print "Called baz()"
class B(Lifecycle):
def __init__(self):
super(B, self).__init__()
@Lifecycle.startmethod
def funk(self, *args):
print "Called funk()"
@Lifecycle.stopmethod
def soul(self, *args):
print "Called soul()"
@Lifecycle.failmethod
def boogie(self, *args):
print "Called boogie()"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment