Browse Source

Ajout d'un warning si des chansons ne peuvent pas être importées

Évoqué dans #24
pull/27/head
Louis 11 years ago
parent
commit
349aecda09
  1. 8
      songbook_core/songs.py

8
songbook_core/songs.py

@ -8,10 +8,12 @@ import glob
import locale
import os.path
import re
import logging
from songbook_core.authors import processauthors
from songbook_core.plastex import parsetex
LOGGER = logging.getLogger(__name__)
# pylint: disable=too-few-public-methods
class Song(object):
@ -122,8 +124,14 @@ class SongsList(object):
le module glob.
"""
for regexp in filelist:
before = len(self.songs)
for filename in glob.iglob(os.path.join(self._songdir, regexp)):
self.append(filename)
if len(self.songs) == before:
# No songs were added
LOGGER.warning(
"Expression '{}' did not match any file".format(regexp)
)
def languages(self):
"""Renvoie la liste des langues utilisées par les chansons"""

Loading…
Cancel
Save