Log a warning (rather than raising a Failure) on glob-loading a non-curve
[hooke.git] / hooke / plugin / playlist.py
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):