Resolves #56 by moving kmk.common.* up a level to kmk.*

This commit is contained in:
Josh Klar committed 2018-10-11 18:13:29 -07:00
1 parent 30cd5da3f1
commit 00899d1b0f
35 files changed
+85 -88

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
class AttrDict(dict):
'''
Primitive support for accessing dictionary entries in dot notation.
Mostly for user-facing stuff (allows for `k.KC_ESC` rather than
`k['KC_ESC']`, which gets a bit obnoxious).
This is read-only on purpose.
'''
def __getattr__(self, key):
return self[key]
class Anything:
'''
A stub class which will repr as a provided name
'''
def __init__(self, name):
self.name = name
def __repr__(self):
return 'Anything<{}>'.format(self.name)
class Passthrough:
def __getattr__(self, attr):
return Anything(attr)