git://git.onelab.eu
/
unfold.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Autocomplete working in query_editor plugin
[unfold.git]
/
manifold
/
util
/
enum.py
diff --git a/manifold/util/enum.py
b/manifold/util/enum.py
new file mode 100644
(file)
index 0000000..
4f3c577
--- /dev/null
+++ b/
manifold/util/enum.py
@@ -0,0
+1,7
@@
+class Enum(object):
+ def __init__(self, *keys):
+ self.__dict__.update(zip(keys, range(len(keys))))
+ self.invmap = {v:k for k, v in self.__dict__.items()}
+
+ def get_str(self, value):
+ return self.invmap[value]