diff options
author | Sebastian Koslowski <sebastian.koslowski@gmail.com> | 2017-11-08 19:05:19 +0100 |
---|---|---|
committer | Sebastian Koslowski <sebastian.koslowski@gmail.com> | 2017-11-08 19:30:41 +0100 |
commit | fbc1627340ea3ed4bedc3424d5a2ec3736e66b4b (patch) | |
tree | 83d83a227b87c61eb36075408bf1589fab03b5c5 /grc/core/blocks/_flags.py | |
parent | 1fa89b3704d7f476e4395eb9358d5a6d7642251b (diff) |
grc: move port and param init to block builder
Diffstat (limited to 'grc/core/blocks/_flags.py')
-rw-r--r-- | grc/core/blocks/_flags.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/grc/core/blocks/_flags.py b/grc/core/blocks/_flags.py index ffea2ad569..bbedd6a2d7 100644 --- a/grc/core/blocks/_flags.py +++ b/grc/core/blocks/_flags.py @@ -17,10 +17,8 @@ from __future__ import absolute_import -import six - -class Flags(six.text_type): +class Flags(object): THROTTLE = 'throttle' DISABLE_BYPASS = 'disable_bypass' @@ -28,12 +26,14 @@ class Flags(six.text_type): DEPRECATED = 'deprecated' NOT_DSP = 'not_dsp' + def __init__(self, flags): + self.data = set(flags) + def __getattr__(self, item): return item in self - def __add__(self, other): - if not isinstance(other, six.string_types): - return NotImplemented - return self.__class__(str(self) + other) + def __contains__(self, item): + return item in self.data - __iadd__ = __add__ + def set(self, *flags): + self.data.update(flags) |