Created
March 11, 2012 12:07
-
-
Save AeroNotix/2016207 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Defaults: | |
def __init__(self, *defaults): | |
""" | |
defaults: A list of (name, value, description) tuples. | |
""" | |
self.defaults = defaults | |
def load(self, target, config): | |
""" | |
Loads a dict of attributes, using specified defaults, onto target. | |
""" | |
debug_file = open("/home/xeno/qtile_debug", "a") | |
debug_file.write(''.join([str(target), '\n'])) | |
for item in self.defaults: | |
debug_file.write(str(item)) | |
debug_file.write('\n') | |
debug_file.write('\n\n') | |
debug_file.close() | |
for i in self.defaults: | |
val = config.get(i[0], i[1]) | |
setattr(target, i[0], val) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment