Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CursorKind(object):
- """
- A CursorKind describes the kind of entity that a cursor points to.
- """
- # The unique kind objects, indexed by id.
- _kinds = {}
- _name_map = None
- def __init__(self, value):
- if value is in CursorKind._kinds:
- raise ValueError,'CursorKind already loaded'
- self.value = value
- CursorKind._kinds[value] = self
- CursorKind._name_map = None
- def from_param(self):
- return self.value
- @property
- def name(self):
- """Get the enumeration name of this cursor kind."""
- if self._name_map is None:
- self._name_map = {}
- for key,value in CursorKind._kinds.items():
- self._name_map[value] = key
- return self._name_map[self]
Add Comment
Please, Sign In to add comment