diff options
author | Andrej Rode <mail@andrejro.de> | 2018-06-23 17:44:58 +0200 |
---|---|---|
committer | Andrej Rode <mail@andrejro.de> | 2018-06-23 17:44:58 +0200 |
commit | 5e07e65fe9350a51cd45f8f21cfa6bf144e42e1c (patch) | |
tree | b88dde44a0ba1f2ce1b382bbca02e80050f77a17 /grc/core/blocks/_flags.py | |
parent | 9f7e39ee5141791f93dbc1c842b1d1a49e33b068 (diff) | |
parent | e82e337d0c74fa7ea5e8b8429de29bec43818552 (diff) |
Merge branch 'python3_fix' into python3_merge
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) |