Last active
December 31, 2015 01:19
-
-
Save RobCombs/7913013 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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