def check(self): match = self.title_re.search(self.html) if slugify(match.group('artist')) != slugify(self.artist): print ('%s != %s' % (slugify(match.group('artist')), slugify(self.artist))) return False if slugify(match.group('title')) != slugify(self.title): print ('%s != %s' % (slugify(match.group('title')), slugify(self.title))) return False return True
def __setattr__(self, attr, value): if attr == 'name': super(Album, self).__setattr__('slug', slugify(value)) super(Album, self).__setattr__(attr, value)
def __setattr__(self, attr, value): if attr == 'title': super(Track, self).__setattr__('slug', slugify(value)) super(Track, self).__setattr__(attr, value)