Browse Source

Corrected an error about "authwords"

Closes #50
pull/54/head
Louis 11 years ago
parent
commit
4b5758732a
  1. 2
      patacrep/authors.py
  2. 6
      patacrep/build.py
  3. 12
      patacrep/data/templates/default.tex
  4. 2
      patacrep/songs.py

2
patacrep/authors.py

@ -48,7 +48,7 @@ def split_author_names(string):
ignore_space = False
last_space = index = 0
brace_count = 0
for char in string:
for char in string.strip():
index += 1
if brace_count == 0:
if char == "\\":

6
patacrep/build.py

@ -4,6 +4,7 @@
"""Build a songbook, according to parameters found in a .sb file."""
import codecs
import copy
import glob
import logging
import os.path
@ -95,7 +96,9 @@ class Songbook(object):
config.update(renderer.get_variables())
config.update(self.config)
config['authwords'] = authors.compile_authwords(config['authwords'])
config['_compiled_authwords'] = authors.compile_authwords(
copy.deepcopy(config['authwords'])
)
self.config = config
# Configuration set
@ -105,7 +108,6 @@ class Songbook(object):
self.config,
)
self.config['render_content'] = content.render_content
self.config['titleprefixkeys'] = ["after", "sep", "ignore"]
self.config['content'] = self.contentlist
self.config['filename'] = output.name[:-4]

12
patacrep/data/templates/default.tex

@ -88,14 +88,14 @@
(* for prefix in titleprefixwords *)
\titleprefixword{((prefix))}
(* endfor*)
(* for key in titleprefixkeys *)
(* for word in authwords.key *)
(* if key=="after" *)
(* for word in authwords.ignore *)
\authignoreword{((word))}
(* endfor *)
(* for word in authwords.after *)
\authbyword{((word))}
(* else *)
\auth((key))word{((word))}
(* endif *)
(* endfor *)
(* for word in authwords.sep *)
\authsepword{((word))}
(* endfor *)
(* if notenamesout=="alphascale" *)

2
patacrep/songs.py

@ -31,7 +31,7 @@ class Song(object):
if "by" in self.args.keys():
self.authors = processauthors(
self.args["by"],
**config["authwords"]
**config["_compiled_authwords"]
)
else:
self.authors = []

Loading…
Cancel
Save