Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/xlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-02-27 19:22:17 +0300
committerSoumith Chintala <soumith@gmail.com>2016-02-27 19:22:17 +0300
commit98c11caac263e21f793ab2e6a8ed536b3c7cb135 (patch)
tree418bbad508e53b263a882460de5499587fdf19ac
parentab8ffadd0df03ebdacb6abc2c049216310217e1a (diff)
parent87ae1f554b85c661ddae32a79afd514c899eea2c (diff)
Merge pull request #15 from jnhwkim/patch-1
fix to center align of a progress indicator
-rw-r--r--init.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 838362f..fad5ae8 100644
--- a/init.lua
+++ b/init.lua
@@ -284,13 +284,14 @@ do
end
-- Print remaining time when running or total time when done.
if (percent < barLength) then
- io.write('ETA: ' .. formatTime(remaining))
+ tm = ' ETA: ' .. formatTime(remaining)
else
- io.write('Tot: ' .. formatTime(elapsed))
+ tm = ' Tot: ' .. formatTime(elapsed)
end
- io.write(' | Step: ' .. formatTime(step))
+ tm = tm .. ' | Step: ' .. formatTime(step)
+ io.write(tm)
-- go back to center of bar, and print progress
- for i=1,6+#tm+barLength/2 do io.write('\b') end
+ for i=1,5+#tm+barLength/2 do io.write('\b') end
io.write(' ', current, '/', goal, ' ')
-- reset for next bar
if (percent == barLength) then