'Set the output file and clear the list of already added
dependencies.
`output_file` must be a string.  The specified file is
immediately overwritten.
If output_file is \'-\', the output will be written to stdout.
If it is None, no file output is done when calling add().'

def set_output(self, output_file):

    self.list = []
    if (output_file == '-'):
        self.file = sys.stdout
    elif output_file:
        self.file = open(output_file, 'w')
    else:
        self.file = None
