use it as an argument for the call to the method self.style.MIGRATE_HEADING, write the result to self.stdout. call the method writer.as_string, append newline to the result, write it to self.stdout.
self . stdout . write ( "%s\n" % writer . as_string ( ) )