+2006-03-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * python/lilylib.py (print_environment): move ps_page_count to lilypond-book.py
+
2006-03-12 Han-Wen Nienhuys <hanwen@xs4all.nl>
* Documentation/user/music-glossary.tely (G clef): fix clef alignments.
# (c) 1998--2006 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\) *(
-### replace:\1ly.\2 (
-
-### subst: \(help_summary\|keep_temp_dir_p\|option_definitions\|original_dir\|program_name\|pseudo_filter_p\|temp_dir\|verbose_p\)
-
import __main__
import glob
import os
import optparse
import subprocess
+## windows mingw cross compile doesn't have selectmodule.so
+have_select = True
+try:
+ import select
+except ImportError:
+ have_select = False
+
################################################################
# Users of python modules should include this snippet
# and customize variables below.
log = ''
+ if not have_select:
+ show_progress = True
+
if show_progress:
retval = proc.wait()
else:
sys.stderr.write ("%s=\"%s\"\n" % (k, v))
-def ps_page_count (ps_name):
- header = open (ps_name).read (1024)
- m = re.search ('\n%%Pages: ([0-9]+)', header)
- if m:
- return string.atoi (m.group (1))
- return 0
-
class NonDentedHeadingFormatter (optparse.IndentedHelpFormatter):
def format_heading(self, heading):
if heading:
def error (s):
sys.stderr.write (program_name + ": " + _ ("error: %s") % s + '\n')
+def ps_page_count (ps_name):
+ header = open (ps_name).read (1024)
+ m = re.search ('\n%%Pages: ([0-9]+)', header)
+ if m:
+ return string.atoi (m.group (1))
+ return 0
+
def warranty ():
identify ()
sys.stdout.write ('''
page_count = 0
if ok:
- page_count = ly.ps_page_count (base + '.eps')
+ page_count = ps_page_count (base + '.eps')
if page_count == 1:
ok = ok and os.path.exists (base + '.png')
and (not os.path.exists (single) \
or (os.stat (multiple)[stat.ST_MTIME] \
> os.stat (single)[stat.ST_MTIME])):
- count = ly.ps_page_count ('%(base)s.eps' % vars ())
+ count = ps_page_count ('%(base)s.eps' % vars ())
images = ['%s-page%d.png' % (base, a) for a in range (1, count+1)]
images = tuple (images)
return images