From f80b5a62bcee884c28149a270eb2591db9ce0890 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Sat, 7 Nov 2015 15:33:02 +0100 Subject: [PATCH] Move the default_lang out of the config dict --- patacrep/songs/__init__.py | 1 + patacrep/songs/chordpro/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/patacrep/songs/__init__.py b/patacrep/songs/__init__.py index 08574959..833f4fe9 100644 --- a/patacrep/songs/__init__.py +++ b/patacrep/songs/__init__.py @@ -102,6 +102,7 @@ class Song: self.datadir = datadir self.fullpath = os.path.join(self.datadir, subpath) self.encoding = config["encoding"] + self.default_lang = config["lang"] self.config = config if self.datadir and self.config['_cache']: diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py index a8314548..323548e9 100644 --- a/patacrep/songs/chordpro/__init__.py +++ b/patacrep/songs/chordpro/__init__.py @@ -31,7 +31,7 @@ class ChordproSong(Song): song = parse_song(song.read(), self.fullpath) self.authors = song.authors self.titles = song.titles - self.lang = song.get_data_argument('language', self.config['lang']) + self.lang = song.get_data_argument('language', self.default_lang) self.data = song.meta self.cached = { 'song': song,