--- /dev/null
+# 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);
+`}
import neo4j
import console
+import flush_stdout
# A storage medium for a graph.
#
# `show_done`.
protected fun prepare_display do
printn "{term_save_cursor} "
+ flush_stdout
end
# 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.
# For use in the implementation of `save_all` only.
protected fun show_done do
print "{term_rewind} Done."
+ flush_stdout
end
end
import doxml
import graph_store
import console
+import flush_stdout
import opts
# An importation task.
else
printn "Reading {dir}... "
end
+ flush_stdout
loop
for f in dir.files do
var path = dir/f
else
print "{file_count} files read."
end
+ flush_stdout
end
# Check the project’s name.
# 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