]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/lilylib.py
* scm/output-ps.scm (header): Papersize from paper.
[lilypond.git] / python / lilylib.py
index b3dde26a20795792a3899d1dae072ed203750b71..4df1532a19d04302af197533d9faf5ac54728c94 100644 (file)
@@ -433,6 +433,7 @@ def print_environment ():
        for (k,v) in os.environ.items ():
                sys.stderr.write ("%s=\"%s\"\n" % (k, v)) 
 
+BOUNDING_BOX_RE = '^%%BoundingBox: (-?[0-9]+) (-?[0-9]+) (-?[0-9]+) (-?[0-9]+)'
 def get_bbox (filename):
        bbox = filename + '.bbox'
        ## -sOutputFile does not work with bbox?
@@ -440,8 +441,7 @@ def get_bbox (filename):
              (filename, bbox)
        system (cmd, progress_p = 1)
        box = open (bbox).read ()
-       m = re.match ('^%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)',
-                     box)
+       m = re.match (BOUNDING_BOX_RE, box)
        gr = []
        if m:
                gr = map (string.atoi, m.groups ())