equal
deleted
inserted
replaced
732 def __init__(self, mimetype, once_is_enough=False): |
732 def __init__(self, mimetype, once_is_enough=False): |
733 super(has_mimetype, self).__init__(once_is_enough) |
733 super(has_mimetype, self).__init__(once_is_enough) |
734 self.mimetype = mimetype |
734 self.mimetype = mimetype |
735 |
735 |
736 def score_entity(self, entity): |
736 def score_entity(self, entity): |
737 idownloadable = entity.cw_adapt_to('IDownloadable') |
737 idownloadable = entity.cw_adapt_to('IDownloadable') |
738 if idownloadable is None: |
738 if idownloadable is None: |
739 return 0 |
739 return 0 |
740 mt = idownloadable.download_content_type() |
740 mt = idownloadable.download_content_type() |
741 if not (mt and mt.startswith(self.mimetype)): |
741 if not (mt and mt.startswith(self.mimetype)): |
742 return 0 |
742 return 0 |