def IsEnabled(feature_name, default=False):
"""Indicates if a specific feature flag is enabled.
Args:
feature_name: The name of the feature flag to check.
default: Default value if the flags are not initialized (In a test
environment for example).
Returns:
True/False if the flag is set/not set or default if the feature flags
were not initialized.
"""
try:
return feature_name in __builtin__._APPENGINE_FEATURE_FLAGS
except AttributeError:
return default
评论列表
文章目录