[game-data-packager] 04/07: make load_games() progress indicator work more like the one in HashedFile
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Thu Mar 26 15:15:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
detiste-guest pushed a commit to branch master
in repository game-data-packager.
commit 1d4fba14cb4823ea329cc683c4c30e7d2935a79a
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Fri Mar 20 11:58:56 2015 +0100
make load_games() progress indicator work more like the one in HashedFile
---
game_data_packager/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index 12c884b..d63ae95 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -2435,7 +2435,7 @@ def load_games(workdir=None):
games = {}
for jsonfile in glob.glob(os.path.join(DATADIR, '*.json')):
- print('.', end='', flush=True)
+ if sys.stderr.isatty(): print('.', end='', flush=True, file=sys.stderr)
try:
g = os.path.basename(jsonfile)
g = g[:len(g) - 5]
@@ -2456,7 +2456,7 @@ def load_games(workdir=None):
print('Error loading %s:\n' % jsonfile)
raise
- print('\r', end='', flush=True)
+ print('\r%s\r' % (' ' * len(games)), end='', flush=True, file=sys.stderr)
return games
def run_command_line():
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git
More information about the Pkg-games-commits
mailing list