X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=python%2Flilylib.py;h=877b98e360b1a67cd0390627385e524d9c87a9da;hb=0d132fde129eb9684c63f2c7f07cb0651d8110e7;hp=e902feb13404926dc2ea83cc81e0c1d15e210671;hpb=bd78c003160e138bc3118ee8ede5929d6011d58e;p=lilypond.git diff --git a/python/lilylib.py b/python/lilylib.py index e902feb134..877b98e360 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -123,10 +123,41 @@ def subprocess_system (cmd, return abs (retval) +def ossystem_system (cmd, + ignore_error=False, + progress_p=True, + be_verbose=False, + log_file=None): + + + name = command_name (cmd) + if be_verbose: + show_progress = 1 + progress (_ ("Invoking `%s\'") % cmd) + else: + progress ( _("Running %s...") % name) + + retval = os.system (cmd) + if retval: + print >>sys.stderr, 'command failed:', cmd + if retval < 0: + print >>sys.stderr, "Child was terminated by signal", -retval + elif retval > 0: + print >>sys.stderr, "Child returned", retval + + if ignore_error: + print >>sys.stderr, "Error ignored" + else: + sys.exit (1) + + return abs (retval) system = subprocess_system +if sys.platform == 'mingw32': + ## subprocess x-compile doesn't work. + system = ossystem_system def strip_extension (f, ext): (p, e) = os.path.splitext (f)