Skip to content

Instantly share code, notes, and snippets.

@Alphadelta14
Created January 22, 2017 18:24
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 Alphadelta14/8a7febc4db9481a6a82469cb653e518d to your computer and use it in GitHub Desktop.
Save Alphadelta14/8a7febc4db9481a6a82469cb653e518d to your computer and use it in GitHub Desktop.
class BoundCondition(ConditionalMixin):
def __init__(self, build=None, suite=None, callback=None):
self.bound_build = build
self.bound_suite = suite
self.bound_callback = callback
ConditionalMixin.__init__(self)
@staticmethod
def build(build_inst):
condition = BoundCondition(build=build_inst)
condition.build = build_inst
return condition
def and_(self, other):
new = BoundCondition(
build=self.bound_build, suite=self.bound_suite, callback=self.bound_callback
)
new.sub_conditions = [self, other]
new.sub_condition_any = False
return new
__and__ = and_
__add__ = and_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment