neo_doxygen: Do not manually flush the output.
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Tue, 16 Dec 2014 16:56:24 +0000 (11:56 -0500)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Tue, 16 Dec 2014 16:56:24 +0000 (11:56 -0500)
The standard library now takes care of this for us.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

contrib/neo_doxygen/src/flush_stdout.nit [deleted file]
contrib/neo_doxygen/src/graph_store.nit
contrib/neo_doxygen/src/neo_doxygen.nit

diff --git a/contrib/neo_doxygen/src/flush_stdout.nit b/contrib/neo_doxygen/src/flush_stdout.nit
deleted file mode 100644 (file)
index 30be3fc..0000000
+++ /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 <stdio.h>
-`}
-
-# Flush the standard output.
-fun flush_stdout in "C" `{
-       fflush(stdout);
-`}
index b15ae4f..dece71e 100644 (file)
@@ -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
 
index 48bb5ad..46c6be2 100644 (file)
@@ -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