Browse Source

Corrections (due to problems with git merge)

pull/70/head
Louis 10 years ago
parent
commit
edf844f98d
  1. 4
      patacrep/content/song.py
  2. 6
      patacrep/files.py
  3. 6
      patacrep/songs/__init__.py

4
patacrep/content/song.py

@ -64,16 +64,16 @@ def parse(keyword, argument, contentlist, config):
continue
with files.chdir(songdir.datadir):
for filename in glob.iglob(os.path.join(songdir.subpath, elem)):
LOGGER.debug('Parsing file "{}"'.format(filename))
extension = filename.split(".")[-1]
if extension not in plugins:
LOGGER.warning(
'File "{}" does not end with one of {}. Ignored.'
'I do not know how to parse "{}": name does not end with one of {}. Ignored.'
).format(
os.path.join(songdir.datadir, filename),
", ".join(["'.{}'".format(key) for key in plugins.keys()]),
)
continue
LOGGER.debug('Parsing file "{}"'.format(filename))
renderer = SongRenderer(plugins[extension](
songdir.datadir,
filename,

6
patacrep/files.py

@ -13,7 +13,11 @@ LOGGER = logging.getLogger(__name__)
def recursive_find(root_directory, extensions):
"""Recursively find files with the given extensions, from a root_directory.
Return a list of files ending with one of the given extensions.
Return a list of files matching those conditions.
Arguments:
- `extensions`: list of accepted extensions.
- `root_directory`: root directory of the search.
"""
if not os.path.isdir(root_directory):
return []

6
patacrep/songs/__init__.py

@ -96,12 +96,6 @@ class Song(Content):
"_version",
]
# Default data
DEFAULT_DATA = {
'@titles': [],
'@languages': [],
}
def __init__(self, datadir, subpath, config):
self.fullpath = os.path.join(datadir, subpath)
self.datadir = datadir

Loading…
Cancel
Save