lilypond-user
[Top][All Lists]
Advanced

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

Re: lilypond on MacOSx


From: Mats Bengtsson
Subject: Re: lilypond on MacOSx
Date: Wed, 14 Aug 2002 13:44:34 +0200

> I installed lilypond on Mac OS X using fink. I've had success in
> generating hardcopy from the command line using 'lilypond' followed by
> 'tex' and 'dvips'; I've had no luck with any of the python scripts or
> midi output.
> 
> Traceback (most recent call last):
>   File "/sw/bin/ly2dvi", line 825, in ?
>     setup_environment ()
>   File "/sw/bin/ly2dvi", line 375, in setup_environment
>     del os.environ['TEXMF']
>   File "/sw/lib/python2.2/os.py", line 423, in __delitem__
>     del self.data[key]
> KeyError: TEXMF

It seems from the Python documentation that the Mac version of
Python does not include any os.putenv() function which in turn
means that environment variables cannot be changed via 
os.environment. I don't really know anything about Mac, but
it might be possible to do something like in the attached 
patch. Could you please try it and see if it helps. In that
case we could include it in the future Lilypond versions.

   /Mats

--- ly2dvi~ Mon Aug 12 20:26:15 2002
+++ ly2dvi  Wed Aug 14 13:41:26 2002
@@ -405,19 +405,22 @@
 }
 
 def setup_environment ():
-       # $TEXMF is special, previous value is already taken care of
-       if os.environ.has_key ('TEXMF'):
-               del os.environ['TEXMF']
+       try:
+               # $TEXMF is special, previous value is already taken care of
+               if os.environ.has_key ('TEXMF'):
+                       del os.environ['TEXMF']
  
-       for key in environment.keys ():
-               val = environment[key]
-               if os.environ.has_key (key):
-                       val = os.environ[key] + os.pathsep + val 
-               os.environ[key] = val
+               for key in environment.keys ():
+                       val = environment[key]
+                       if os.environ.has_key (key):
+                               val = os.environ[key] + os.pathsep + val 
+                       os.environ[key] = val
 
-       for key in non_path_environment.keys ():
-               val = non_path_environment[key]
-               os.environ[key] = val
+               for key in non_path_environment.keys ():
+                       val = non_path_environment[key]
+                       os.environ[key] = val
+       except:
+               pass






reply via email to

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