Skip to content
Browse files

ENH: inform if no notebooks found + simplified one prev msg

  • Loading branch information...
1 parent 967dcf6 commit 785320e10bf0f0527b158e6bccd430e3336fc8c1 @yarikoptic yarikoptic committed Sep 16, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 bin/pymvpa2-tutorial
View
8 bin/pymvpa2-tutorial
@@ -110,7 +110,8 @@ def main():
src = os.path.join(os.path.abspath(tutorial_datadir), dir)
dst = os.path.join(os.path.abspath(workdir), dir)
if os.path.lexists(dst):
- print "Use existing tutorial 'data' path already exists at '%s'." % dst
+ print "Use existing tutorial '%s' path at '%s'." \
+ % (dir, dst)
continue
if not os.path.exists(src):
print "Cannot find tutorial data at '%s'" % src
@@ -134,7 +135,10 @@ def main():
ipy_args.append('--notebook-dir=%s' % notebook_dstdir)
if not os.path.exists(notebook_dstdir):
os.makedirs(notebook_dstdir)
- for nb in glob.glob(os.path.join(notebook_srcdir, '*.ipynb')):
+ notebook_files = glob.glob(os.path.join(notebook_srcdir, '*.ipynb'))
+ if not len(notebook_files):
+ print "Beware: no notebooks found under %s" % notebook_srcdir
+ for nb in notebook_files:
nb_dst_filepath = os.path.join(notebook_dstdir, os.path.basename(nb))
if not os.path.exists(nb_dst_filepath) or want_overwrite_notebooks:
shutil.copyfile(nb, nb_dst_filepath)

0 comments on commit 785320e

Please sign in to comment.
Something went wrong with that request. Please try again.