#
# source file of the GNU LilyPond music typesetter
#
-# (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+# (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
# Jan Nieuwenhuizen <janneke@gnu.org>
### subst:\(^\|[^._a-z]\)\(abspath\|identify\|warranty\|progress\|warning\|error\|exit\|getopt_args\|option_help_str\|options_help_str\|help\|setup_temp\|read_pipe\|system\|cleanup_temp\|strip_extension\|cp_to_dir\|mkdir_p\|init\) *(
sys.path.insert (0, os.path.join (datadir, 'python'))
+
+
# Customize these
if __name__ == '__main__':
import lilylib as ly
program_version = '@TOPLEVEL_VERSION@'
if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
- program_version = '1.7.5'
+ program_version = '1.7.14'
def identify (port):
port.write ('%s (GNU LilyPond) %s\n' % (__main__.program_name, program_version))
def warranty ():
identify (sys.stdout)
sys.stdout.write ('\n')
- sys.stdout.write (_ ('Copyright (c) %s by' % ' 1998--2002'))
+ sys.stdout.write (_ ('Copyright (c) %s by' % ' 1998--2003'))
sys.stdout.write ('\n')
map (lambda x: sys.stdout.write (' %s\n' % x), __main__.copyright)
sys.stdout.write ('\n')
if not __main__.keep_temp_dir_p:
__main__.temp_dir = tempfile.mktemp (__main__.program_name)
try:
- os.mkdir (__main__.temp_dir, 0777)
+ os.mkdir (__main__.temp_dir, 0700)
except OSError:
pass
cmd = r'''gs -g%dx%d -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=%s -r%d -dNOPAUSE %s %s -c quit ''' % \
(x, y, png, __main__.preview_resolution, trans_ps, preview_ps)
- system (cmd)
-
status = system (cmd)
signal = 0xf & status
exit_status = status >> 8
os.unlink (png)
error (_ ("Removing output file"))
exit (1)
+
+def make_page_images (name, resolution = 90):
+
+ """ Generate images for
+ all pages in the PS file NAME. NAME should be the basename
+ (not including the extension.).
+ """
+
+ cmd = 'gs -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile="%s-page%%d.png" -r%d -dNOPAUSE %s -c quit'
+ cmd = cmd % (name, resolution, name + '.ps')
+ system (cmd)