+
+
+class SaveCommand (Command):
+ """Save the current configuration options.
+ """
+ def __init__(self, plugin):
+ super(SaveCommand, self).__init__(
+ name='save config',
+ arguments=[
+ Argument(name='output', type='file',
+ help="""
+File name for the output configuration. Defaults to overwriting the
+most local loaded config file.
+""".strip()),
+ ],
+ help=self.__doc__, plugin=plugin)
+
+ def _run(self, hooke, inqueue, outqueue, params):
+ f = None
+ try:
+ if params['output'] != None:
+ f = open(params['output'], 'w')
+ hooke.config.write(fp=f)
+ finally:
+ if f != None:
+ f.close()