lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delay import of `midi' module. (issue 297420043 by address@hidden)


From: lemzwerg
Subject: Re: Delay import of `midi' module. (issue 297420043 by address@hidden)
Date: Tue, 31 May 2016 03:35:45 -0700

Reviewers: dak,

Message:
Ok, running the script with just --version or --help does indeed not
need the midi module.

Yep.

This is ugly as whatever but likely will do the trick.

:-) Interestingly, I haven't find out yet how `midi.c' gets compiled
at all; I can't find any trace of it in the log file that I catch

  make all &> make.all.log

Can you push this right to staging

Done.


Description:
Delay import of `midi' module.

`make all' starts with generating the manual pages for lilypond's python
scripts using help2man.  However, at the time `midi2ly --help' gets
called,
the `midi' python module (which is based on code written in C) imported
by
`midi2ly' has not been compiled yet, making help2man abort.

Please review this at https://codereview.appspot.com/297420043/

Affected files (+2, -1 lines):
  M scripts/midi2ly.py


Index: scripts/midi2ly.py
diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py
index f4a47fb79ab963c889a9d372b9952e89ac3cdbd9..b3600fa2e3b416e848bb62bfa5f1f8332c87de00 100644
--- a/scripts/midi2ly.py
+++ b/scripts/midi2ly.py
@@ -32,7 +32,6 @@ import sys
 @relocate-preamble@
 """

-import midi
 import lilylib as ly
 global _;_=ly._

@@ -923,6 +922,8 @@ class Staff:
         return dump_track (self.voices, i)

 def convert_midi (in_file, out_file):
+    import midi
+
     global clocks_per_1, clocks_per_4, key
     global start_quant_clocks
     global duration_quant_clocks





reply via email to

[Prev in Thread] Current Thread [Next in Thread]