cc-3936: Added assertion for organizer to only handle correct events.

This commit is contained in:
Rudi Grinberg 2012-08-27 12:08:21 -04:00
parent 7270893b4d
commit 97bb041ba3
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import media.monitor.owners as owners
from media.monitor.handler import ReportHandler from media.monitor.handler import ReportHandler
from media.monitor.log import Loggable from media.monitor.log import Loggable
from media.monitor.exceptions import BadSongFile from media.monitor.exceptions import BadSongFile
from media.monitor.events import OrganizeFile
class Organizer(ReportHandler,Loggable): class Organizer(ReportHandler,Loggable):
""" """
@ -39,6 +40,8 @@ class Organizer(ReportHandler,Loggable):
directory and place it in the correct path (starting with directory and place it in the correct path (starting with
self.target_path) self.target_path)
""" """
# Only handle this event type
assert isinstance(event, OrganizeFile)
try: try:
# We must select the target_path based on whether file was recorded # We must select the target_path based on whether file was recorded
# by airtime or not. # by airtime or not.