def set_output(self):
if not self.output:<EOL><INDENT>return open(devnull, '<STR_LIT:w>')<EOL><DEDENT>output_dir = dirname(self.output)<EOL>if not isdir(output_dir):<EOL><INDENT>try:<EOL><INDENT>makedirs(output_dir)<EOL><DEDENT>except Exception as e:<EOL><INDENT>self.die('<STR_LIT>'.format(output_dir, str(e)))<EOL><DEDENT><DEDENT>return open(self.output, '<STR_LIT:a>')<EOL>
Set the output for the service command.