Skip to content

Commit

Permalink
use stderr for download output - fixes #274
Browse files Browse the repository at this point in the history
  • Loading branch information
iiSeymour committed Jun 27, 2022
1 parent 50f50db commit f0827d9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions bonito/cli/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import re
import sys
from shutil import rmtree
from zipfile import ZipFile
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
Expand Down Expand Up @@ -45,7 +46,7 @@ def download(self):

# skip download if local file is found
if self.exists(fname.strip('.zip')) and not self.force:
print("[skipping %s]" % fname)
print("[skipping %s]" % fname, file=sys.stderr)
return

if self.exists(fname.strip('.zip')) and self.force:
Expand All @@ -58,7 +59,7 @@ def download(self):
f.write(data)
t.update(len(data))

print("[downloaded %s]" % fname)
print("[downloaded %s]" % fname, file=sys.stderr)

# unzip .zip files
if fname.endswith('.zip'):
Expand All @@ -68,7 +69,7 @@ def download(self):

# convert chunkify training files to bonito
if fname.endswith('.hdf5'):
print("[converting %s]" % fname)
print("[converting %s]" % fname, file=sys.stderr)
args = cargparser().parse_args([
self.location(fname),
self.location(fname).strip('.hdf5')
Expand Down Expand Up @@ -107,15 +108,15 @@ def main(args):
if args.models or args.all:

if args.show:
print("[available models]")
print("[available models]", file=sys.stderr)
for model in models:
print(f" - {model}")
print(f" - {model}", file=sys.stderr)
else:
print("[downloading models]")
print("[downloading models]", file=sys.stderr)
for model in models.values():
File(__models__, model, args.force).download()
if args.training or args.all:
print("[downloading training data]")
print("[downloading training data]", file=sys.stderr)
for train in training:
File(__data__, train, args.force).download()

Expand Down

0 comments on commit f0827d9

Please sign in to comment.