Log a warning (rather than raising a Failure) on glob-loading a non-curve
authorW. Trevor King <wking@drexel.edu>
Sun, 15 Aug 2010 12:11:47 +0000 (08:11 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 15 Aug 2010 12:11:47 +0000 (08:11 -0400)
doc/tutorial.txt
hooke/plugin/playlist.py

index 6bba6cbee80c43abf7ec9df926f7d9d900fb5ec4..51524b7c2cf21fceb78b96e14926b080dbc4b3c5 100644 (file)
@@ -172,7 +172,7 @@ mylist.hkp`` or ``load_playlist mylist``, Hooke will add ``.hkp`` if
 necessary.
 
 If, generating the playlist, you are including by chance a non-force
-curve file that Hooke cannot open, Hooke will print an error and
+curve file that Hooke cannot open, Hooke will log a warning and
 continue on.
 
 Navigating the playlist
index 80c22d2ffa3628ebba2115ece97123d7f52dec78..afd2ef9dc56558a7e213c6c171fb7ad8936b0ad8 100644 (file)
@@ -22,10 +22,12 @@ several associated :class:`hooke.command.Command`\s for handling
 """
 
 import glob
+import logging
 import os.path
 
 from ..command import Command, Argument, Failure
 from ..playlist import FilePlaylist
+from ..curve import NotRecognized
 from . import Builtin
 
 
@@ -302,7 +304,12 @@ Additional information for the input :class:`hooke.curve.Curve`.
     def _run(self, hooke, inqueue, outqueue, params):
         p = self._playlist(hooke, params)
         for path in sorted(glob.glob(params['input'])):
-            p.append_curve_by_path(path, params['info'], hooke=hooke)
+            try:
+                p.append_curve_by_path(path, params['info'], hooke=hooke)
+            except NotRecognized, e:
+                log = logging.getLogger('hooke')
+                log.warn(unicode(e))
+                continue
             outqueue.put(p[-1])
 
 class RemoveCommand (PlaylistCommand):