CVSROOT:        /cvsroot/lilypond
Module name:    installers
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/06/18 11:35:18

Modified files:
        macos/LilyPad  : ChangeLog LilyPond.py lilycall.py 

Log message:
        (Call.open_pdfs): remove stray p.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/installers/macos/LilyPad/ChangeLog.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/installers/macos/LilyPad/LilyPond.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/installers/macos/LilyPad/lilycall.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: installers/macos/LilyPad/ChangeLog
diff -u installers/macos/LilyPad/ChangeLog:1.7 
installers/macos/LilyPad/ChangeLog:1.8
--- installers/macos/LilyPad/ChangeLog:1.7      Fri Jun 17 00:30:43 2005
+++ installers/macos/LilyPad/ChangeLog  Sat Jun 18 11:35:17 2005
@@ -1,7 +1,15 @@
+2005-06-18  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
+
+       * lilycall.py (Call.open_pdfs): remove stray p.
+
 2005-06-17  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * lilycall.py (get_env): set FONTCONFIG_PATH, so local.conf is found.
+       (check_fontconfig): set fonts.cache-1
+
        * LilyPond.py (TinyTinyDocument.compileMe): CallBinder: closure
        for lilycall + document callbacks.
+       (TinyTinyDocument.compileMe): check need_fc_update.
 
        * ProcessLog.py (ProcessLogWindowController.addText): new function.
        (ProcessLogWindowController.finish): stop throbber before callback.
Index: installers/macos/LilyPad/LilyPond.py
diff -u installers/macos/LilyPad/LilyPond.py:1.9 
installers/macos/LilyPad/LilyPond.py:1.10
--- installers/macos/LilyPad/LilyPond.py:1.9    Fri Jun 17 00:30:43 2005
+++ installers/macos/LilyPad/LilyPond.py        Sat Jun 18 11:35:17 2005
@@ -165,32 +165,13 @@
         call = lilycall.Call (appdir, [self.fileName()])
         call.reroute_output = 1
         self.createProcessLog ()
-       class CallBinder:
-               def __init__ (self, call, document):
-                       self.call = call
-                       self.doc = document
-               def fcProcess (self, data = None):
-                       pyproc = call.get_fc_cache_process ()
-                       if not pyproc:
-                               return self.lpProcess()
-
-                       wc = self.doc.processLogWindowController
-                       wc.setWindowTitle_ ('Font cache updater')
-                       wc.addText ('\nCaching font details.\nThis may take a 
few minutes.\n\n\n') 
-                       wc.runProcessWithCallback (pyproc, self.lpProcess)
-                       
-               def lpProcess (self, data = None):
-                       wc = self.doc.processLogWindowController
-                       wc.setWindowTitle_ ('LilyPond -- ' + 
self.doc.fileName())
-                       pyproc = call.get_lilypond_process()
-                       wc.runProcessWithCallback (pyproc, self.open_pdfs)
-
-               def open_pdfs (self, data = None):
-                       self.call.open_pdfs ()
-
-       cb = CallBinder(call, self)
-       cb.fcProcess ()
+       wc = self.processLogWindowController
+       if call.need_fc_update:
+               wc.addText ('\nCaching font details.\nThis may take a few 
minutes.\n\n\n') 
        
+       wc.setWindowTitle_ ('LilyPond -- ' + self.fileName())
+       pyproc = call.get_lilypond_process()
+       wc.runProcessWithCallback (pyproc, call.open_pdfs)
 
     def contextHelp_ (self, sender):
         tv = self.textView
Index: installers/macos/LilyPad/lilycall.py
diff -u installers/macos/LilyPad/lilycall.py:1.2 
installers/macos/LilyPad/lilycall.py:1.3
--- installers/macos/LilyPad/lilycall.py:1.2    Fri Jun 17 00:30:43 2005
+++ installers/macos/LilyPad/lilycall.py        Sat Jun 18 11:35:17 2005
@@ -75,29 +75,15 @@
        my_sysfont_dir = prefix + '/share/SystemFonts'
        sysfont_dir = '/System/Library/Fonts'
 
-       need_fc_update = 0
-       if not os.path.exists (my_sysfont_dir):
-           os.mkdir (my_sysfont_dir)
-           need_fc_update = 1
-           
-       if need_fc_update or file_is_newer (sysfont_dir, my_sysfont_dir):
-           files = os.listdir (sysfont_dir)
-           need_fc_update = 1
-           for f in files:
-                   if not os.path.exists (my_sysfont_dir + '/' + f): 
-                           os.symlink ('%s/%s' % (sysfont_dir, f),
-                                       '%s/%s' % (my_sysfont_dir, f))
-
+       fc_cache = (prefix + '/font.cache-1')
        local_fc_conf = open (prefix + '/etc/fonts/local.conf','w')
        local_fc_conf.write ('''<?xml version="1.0"?>
 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <!-- /etc/fonts/local.conf file for local customizations -->
 <fontconfig>
-<dir>%s
-</dir>
-</fontconfig>''' %  my_sysfont_dir)
-       return need_fc_update
-
+<cache>%s</cache> 
+</fontconfig>''' % fc_cache)
+       return not os.path.exists (fc_cache)
 
 def get_env (prefix):
        p = ''
@@ -108,12 +94,12 @@
 
        env = {} 
        env['DYLD_LIBRARY_PATH'] = prefix + '/lib' + ':' + p
-       env['PATH'] = prefix + '/bin/' + ':' + os.environ['PATH']
+       env['FONTCONFIG_PATH'] = prefix + '/etc/fonts/'
+       env['GS_LIB'] = prefix + '/share/ghostscript/8.15/lib/'
        env['GUILE_LOAD_PATH'] = prefix + '/share/guile/1.6'
        env['LILYPONDPREFIX'] = prefix + '/share/lilypond/current'
-       env['FONTCONFIG_FILE'] = prefix + '/etc/fonts/fonts.conf'
-       env['GS_LIB'] = prefix + '/share/ghostscript/8.15/lib/'
        env['PANGO_RC_FILE'] = prefix + '/etc/pango/pangorc'
+       env['PATH'] = prefix + '/bin/' + ':' + os.environ['PATH']
        return env
 
 
@@ -202,24 +188,6 @@
        
        def get_lilypond_process (self):
                return self.get_process (self.executable, self.args)
-
-       def get_fc_cache_process (self):
-               if not self.need_fc_update:
-                       return None
-
-               prefix = self.appdir + '/Contents/Resources'
-               binary = prefix + '/bin/fc-cache'
-               args = ['/Library/Fonts/',
-                       prefix + '/share/SystemFonts',
-                       prefix + '/share/lilypond/current/fonts/',
-                       '/usr/share/fonts',
-                       '/Library/Fonts',
-                       '~/.fonts']
-               args = filter (lambda x: os.path.exists (x), args)
-               args = ['fc-cache', '-v'] + args 
-               
-               p = self.get_process (binary, args)
-               return p
        
        def get_pdfs (self):
                names = []
@@ -262,10 +230,8 @@
                sys.stderr.write (call.error_string)
                sys.exit (2)
 
-       p = call.get_fc_cache_process ()
-       if p:
-               sys.stderr.write ('Rebuilding font cache')
-               p.wait ()
+       if call.need_fc_update:
+               sys.stderr.write ('Rebuilding font cache\nThis may take a few 
minutes.')
        
        p = call.get_lilypond_process ()
        code = p.wait ()


_______________________________________________
Lilypond-cvs mailing list
Lilypond-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to