from __future__ import absolute_import, unicode_literals


# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
    def __init__(self, tuple_list):
        self.tuple_list = tuple_list

    def __getattr__(self, name):
        if name not in self.tuple_list:
            raise AttributeError("'Enum' has no attribute '{}'".format(name))

        return name


# https://github.com/draft-js-utils/draft-js-utils/blob/master/src/Constants.js
class BLOCK_TYPES:
    UNSTYLED = 'unstyled'
    HEADER_ONE = 'header-one'
    HEADER_TWO = 'header-two'
    HEADER_THREE = 'header-three'
    HEADER_FOUR = 'header-four'
    HEADER_FIVE = 'header-five'
    HEADER_SIX = 'header-six'
    UNORDERED_LIST_ITEM = 'unordered-list-item'
    ORDERED_LIST_ITEM = 'ordered-list-item'
    BLOCKQUOTE = 'blockquote'
    PULLQUOTE = 'pullquote'
    CODE = 'code-block'
    ATOMIC = 'atomic'
    HORIZONTAL_RULE = 'horizontal-rule'

ENTITY_TYPES = Enum(('LINK', 'IMAGE', 'TOKEN'))

INLINE_STYLES = Enum(('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE'))

from __future__ import absolute_import, unicode_literals


# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
    def __init__(self, *elements):
        self.elements = tuple(elements)

    def __getattr__(self, name):
        if name not in self.elements:
            raise AttributeError("'Enum' has no attribute '{}'".format(name))

        return name


# https://github.com/draft-js-utils/draft-js-utils/blob/master/src/Constants.js
class BLOCK_TYPES:
    UNSTYLED = 'unstyled'
    HEADER_ONE = 'header-one'
    HEADER_TWO = 'header-two'
    HEADER_THREE = 'header-three'
    HEADER_FOUR = 'header-four'
    HEADER_FIVE = 'header-five'
    HEADER_SIX = 'header-six'
    UNORDERED_LIST_ITEM = 'unordered-list-item'
    ORDERED_LIST_ITEM = 'ordered-list-item'
    BLOCKQUOTE = 'blockquote'
    PULLQUOTE = 'pullquote'
    CODE = 'code-block'
    ATOMIC = 'atomic'
    HORIZONTAL_RULE = 'horizontal-rule'

ENTITY_TYPES = Enum('LINK', 'IMAGE', 'TOKEN')

INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')

Allow enum to be created more easily
Allow enum to be created more easily

  from __future__ import absolute_import, unicode_literals
  
  
  # http://stackoverflow.com/a/22723724/1798491
  class Enum(object):
-     def __init__(self, tuple_list):
+     def __init__(self, *elements):
-         self.tuple_list = tuple_list
+         self.elements = tuple(elements)
  
      def __getattr__(self, name):
-         if name not in self.tuple_list:
+         if name not in self.elements:
              raise AttributeError("'Enum' has no attribute '{}'".format(name))
  
          return name
  
  
  # https://github.com/draft-js-utils/draft-js-utils/blob/master/src/Constants.js
  class BLOCK_TYPES:
      UNSTYLED = 'unstyled'
      HEADER_ONE = 'header-one'
      HEADER_TWO = 'header-two'
      HEADER_THREE = 'header-three'
      HEADER_FOUR = 'header-four'
      HEADER_FIVE = 'header-five'
      HEADER_SIX = 'header-six'
      UNORDERED_LIST_ITEM = 'unordered-list-item'
      ORDERED_LIST_ITEM = 'ordered-list-item'
      BLOCKQUOTE = 'blockquote'
      PULLQUOTE = 'pullquote'
      CODE = 'code-block'
      ATOMIC = 'atomic'
      HORIZONTAL_RULE = 'horizontal-rule'
  
- ENTITY_TYPES = Enum(('LINK', 'IMAGE', 'TOKEN'))
+ ENTITY_TYPES = Enum('LINK', 'IMAGE', 'TOKEN')
  
- INLINE_STYLES = Enum(('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE'))
+ INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
  
Allow enum to be created more easily
## Code Before:
from __future__ import absolute_import, unicode_literals


# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
    def __init__(self, tuple_list):
        self.tuple_list = tuple_list

    def __getattr__(self, name):
        if name not in self.tuple_list:
            raise AttributeError("'Enum' has no attribute '{}'".format(name))

        return name


# https://github.com/draft-js-utils/draft-js-utils/blob/master/src/Constants.js
class BLOCK_TYPES:
    UNSTYLED = 'unstyled'
    HEADER_ONE = 'header-one'
    HEADER_TWO = 'header-two'
    HEADER_THREE = 'header-three'
    HEADER_FOUR = 'header-four'
    HEADER_FIVE = 'header-five'
    HEADER_SIX = 'header-six'
    UNORDERED_LIST_ITEM = 'unordered-list-item'
    ORDERED_LIST_ITEM = 'ordered-list-item'
    BLOCKQUOTE = 'blockquote'
    PULLQUOTE = 'pullquote'
    CODE = 'code-block'
    ATOMIC = 'atomic'
    HORIZONTAL_RULE = 'horizontal-rule'

ENTITY_TYPES = Enum(('LINK', 'IMAGE', 'TOKEN'))

INLINE_STYLES = Enum(('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE'))

## Instruction:
Allow enum to be created more easily
## Code After:
from __future__ import absolute_import, unicode_literals


# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
    def __init__(self, *elements):
        self.elements = tuple(elements)

    def __getattr__(self, name):
        if name not in self.elements:
            raise AttributeError("'Enum' has no attribute '{}'".format(name))

        return name


# https://github.com/draft-js-utils/draft-js-utils/blob/master/src/Constants.js
class BLOCK_TYPES:
    UNSTYLED = 'unstyled'
    HEADER_ONE = 'header-one'
    HEADER_TWO = 'header-two'
    HEADER_THREE = 'header-three'
    HEADER_FOUR = 'header-four'
    HEADER_FIVE = 'header-five'
    HEADER_SIX = 'header-six'
    UNORDERED_LIST_ITEM = 'unordered-list-item'
    ORDERED_LIST_ITEM = 'ordered-list-item'
    BLOCKQUOTE = 'blockquote'
    PULLQUOTE = 'pullquote'
    CODE = 'code-block'
    ATOMIC = 'atomic'
    HORIZONTAL_RULE = 'horizontal-rule'

ENTITY_TYPES = Enum('LINK', 'IMAGE', 'TOKEN')

INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
