Skip to content

Instantly share code, notes, and snippets.

@RobCombs
Last active December 31, 2015 01:19
Show Gist options
  • Save RobCombs/7913013 to your computer and use it in GitHub Desktop.
Save RobCombs/7913013 to your computer and use it in GitHub Desktop.
def is_active(self, key, *args, **kwargs):
"""Tests if the flag is active"""
ret = self.backend.is_active(key, *args, **kwargs)
if not ret: return False
if key in self.registered_checks:
for check in self.registered_checks[key]:
if not check(key, **kwargs):
return False
return True
from dolphin import flipper
if flipper.is_active("flag_name"):
do_something()
else:
do_something_else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment