Browse Source

Simplify sorted exception

pull/190/head
Oliverpool 9 years ago
parent
commit
5a1127bb3f
  1. 6
      patacrep/content/sorted.py

6
patacrep/content/sorted.py

@ -8,7 +8,7 @@ import logging
import unidecode import unidecode
from patacrep import files from patacrep import files
from patacrep.content import ContentError, EmptyContentList from patacrep.content import ContentError
from patacrep.content import process_content, validate_parser_argument from patacrep.content import process_content, validate_parser_argument
from patacrep.content.song import OnlySongsError from patacrep.content.song import OnlySongsError
@ -101,11 +101,11 @@ def parse(keyword, config, argument):
try: try:
songlist = process_content(argument.get('content'), config) songlist = process_content(argument.get('content'), config)
except OnlySongsError as error: except OnlySongsError as error:
return EmptyContentList(errors=[ContentError(keyword, ( raise ContentError(keyword, (
"Content list of this keyword can be only songs (or content " "Content list of this keyword can be only songs (or content "
"that result into songs), and the following are not:" + "that result into songs), and the following are not:" +
str(error.not_songs) str(error.not_songs)
))]) ))
return sorted(songlist, key=key_generator(sort)) return sorted(songlist, key=key_generator(sort))
CONTENT_PLUGINS = {'sorted': parse} CONTENT_PLUGINS = {'sorted': parse}

Loading…
Cancel
Save