Browse Source

Corrected an error about "authwords"

Closes #50
pull/54/head
Louis 10 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 ignore_space = False
last_space = index = 0 last_space = index = 0
brace_count = 0 brace_count = 0
for char in string: for char in string.strip():
index += 1 index += 1
if brace_count == 0: if brace_count == 0:
if char == "\\": if char == "\\":

6
patacrep/build.py

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

12
patacrep/data/templates/default.tex

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

2
patacrep/songs.py

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

Loading…
Cancel
Save