summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Gourlay <john@weathervanefarm.net>2016-05-26 16:24:23 -0400
committerJohn Gourlay <john@weathervanefarm.net>2016-05-26 16:24:23 -0400
commitbdafccdd85ea487a553ccf676a2d44bd14484fc9 (patch)
tree0935c72c37698d598047511ccc431432764f9659 /python
parent729c453ee49e8e43cb582089b208bb62369dced1 (diff)
In python/musicexp.py:
In the ly output add a space between a direction modifier and quote. Remove a redundant <<. In python/musicxml2ly_conversion.py: Add a definition for _.
Diffstat (limited to 'python')
-rw-r--r--python/musicexp.py9
-rw-r--r--python/musicxml2ly_conversion.py1
2 files changed, 8 insertions, 2 deletions
diff --git a/python/musicexp.py b/python/musicexp.py
index 998267550e..a7b569a5aa 100644
--- a/python/musicexp.py
+++ b/python/musicexp.py
@@ -1361,7 +1361,12 @@ class TextEvent (Event):
return { 1: '^', -1: '_', 0: '-' }.get (self.force_direction, '-')
def ly_expression (self):
- base_string = '%s\"%s\"'
+ # self.text will be enclosed by quotes, and the direction
+ # modifier must be separated from the opening quote by a space.
+ # This is so that subsequent line breaking for the output file
+ # using utilities.split_string_and_preserve_doublequoted_strings()
+ # properly detects the opening quote.
+ base_string = '%s \"%s\"'
if self.markup:
base_string = '%s\markup{ ' + self.markup + ' {%s} }'
return base_string % (self.direction_mod (), self.text)
@@ -2167,7 +2172,7 @@ class StaffGroup:
self.print_ly_context_mods (printer)
for m in self.context_modifications:
printer.dump (m)
- printer.dump ("} <<")
+ printer.dump ("}")
printer.newline ()
#print a single << after StaffGroup only when the with-block is not needed.
#This doesn't work. << is printed before and after StaffGroup!
diff --git a/python/musicxml2ly_conversion.py b/python/musicxml2ly_conversion.py
index 6216b540fb..67df2add83 100644
--- a/python/musicxml2ly_conversion.py
+++ b/python/musicxml2ly_conversion.py
@@ -2,6 +2,7 @@
from rational import *
import lilylib as ly
import musicexp
+_ = ly._
def rational_to_lily_duration(rational_len):
d = musicexp.Duration()