From 3ee92c5eb1374760250b653f1ceb40cdc63c70ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Christophe=20Beaupr=C3=A9?= Date: Tue, 16 Dec 2014 11:56:24 -0500 Subject: [PATCH] neo_doxygen: Do not manually flush the output. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The standard library now takes care of this for us. Signed-off-by: Jean-Christophe Beaupré --- contrib/neo_doxygen/src/flush_stdout.nit | 25 ------------------------- contrib/neo_doxygen/src/graph_store.nit | 8 +------- contrib/neo_doxygen/src/neo_doxygen.nit | 4 ---- 3 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 contrib/neo_doxygen/src/flush_stdout.nit diff --git a/contrib/neo_doxygen/src/flush_stdout.nit b/contrib/neo_doxygen/src/flush_stdout.nit deleted file mode 100644 index 30be3fc..0000000 --- a/contrib/neo_doxygen/src/flush_stdout.nit +++ /dev/null @@ -1,25 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Add the ability to flush the standard output. -module flush_stdout - -in "C Header" `{ - #include -`} - -# Flush the standard output. -fun flush_stdout in "C" `{ - fflush(stdout); -`} diff --git a/contrib/neo_doxygen/src/graph_store.nit b/contrib/neo_doxygen/src/graph_store.nit index b15ae4f..dece71e 100644 --- a/contrib/neo_doxygen/src/graph_store.nit +++ b/contrib/neo_doxygen/src/graph_store.nit @@ -17,7 +17,6 @@ module graph_store import neo4j import console -import flush_stdout # A storage medium for a graph. # @@ -40,17 +39,13 @@ abstract class GraphStore # # This method must be called before the first call to `show_progress` or # `show_done`. - protected fun prepare_display do - printn "{term_save_cursor} " - flush_stdout - end + protected fun prepare_display do printn "{term_save_cursor} " # Show the progress, in percentage. # # For use in the implementation of `save_all` only. protected fun show_progress(progress: Int) do printn "{term_rewind} {progress}% " - flush_stdout end # Show a message to indicate that the task finished with success. @@ -58,7 +53,6 @@ abstract class GraphStore # For use in the implementation of `save_all` only. protected fun show_done do print "{term_rewind} Done." - flush_stdout end end diff --git a/contrib/neo_doxygen/src/neo_doxygen.nit b/contrib/neo_doxygen/src/neo_doxygen.nit index 48bb5ad..46c6be2 100644 --- a/contrib/neo_doxygen/src/neo_doxygen.nit +++ b/contrib/neo_doxygen/src/neo_doxygen.nit @@ -22,7 +22,6 @@ import model import doxml import graph_store import console -import flush_stdout import opts # An importation task. @@ -60,7 +59,6 @@ class NeoDoxygenJob else printn "Reading {dir}... " end - flush_stdout loop for f in list_files(dir) do var path = dir/f @@ -81,7 +79,6 @@ class NeoDoxygenJob else print "{file_count} files read." end - flush_stdout end # List files in a directory. @@ -107,7 +104,6 @@ class NeoDoxygenJob # Save the graph. fun save do sys.stdout.write "Linking nodes...{term_save_cursor} " - flush_stdout model.put_edges print "{term_rewind} Done." var nodes = model.all_nodes -- 1.7.9.5