Last active
September 30, 2015 22:10
-
-
Save cjo20/ce5ff2c7d281ee65ba34 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
def add_option (self, k, v, secret=true): | |
self.fields[k] = v | |
if k not in self.required + self.optional: | |
self.optional.append(k) | |
if secret: | |
self.secret_fields.append(k) | |
def store (self, config): | |
if not config.has_section(self.section_name( )): | |
config.add_device(self) | |
else: | |
for k, v in self.items( ): | |
config.set(self.section_name( ), k, v) | |
for k in self.secret_fields: | |
config.add_secret(self.section_name, k) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment