library-web r444 - in trunk: . src



Author: fpeters
Date: Thu May  8 18:00:56 2008
New Revision: 444
URL: http://svn.gnome.org/viewvc/library-web?rev=444&view=rev

Log:
* src/lgo.py: don't create tarballs when creating file layout for them
was skipped because module had already been generated.
(closes: #532023)



Modified:
   trunk/ChangeLog
   trunk/src/lgo.py

Modified: trunk/src/lgo.py
==============================================================================
--- trunk/src/lgo.py	(original)
+++ trunk/src/lgo.py	Thu May  8 18:00:56 2008
@@ -821,6 +821,8 @@
 
         base_tarball_name = os.path.basename(self.filename).rsplit('-', 1)[0]
 
+        create_tarball = app.config.create_tarballs
+
         for lang in doc.languages:
             if lang == 'en' and not os.path.exists(os.path.join(ext_dirname, self.dirname, 'en')):
                 lang_dirname = os.path.join(ext_dirname, self.dirname, 'C')
@@ -845,8 +847,9 @@
                     except errors.DepreciatedDocumentation:
                         break
 
-                    if not app.config.create_tarballs or os.path.exists(tarball_filepath):
+                    if not create_tarball or os.path.exists(tarball_filepath):
                         logging.debug('using already generated doc in %s' % lang)
+                        create_tarball = False
                         continue
                     skip_html_files = True
 
@@ -917,7 +920,7 @@
                     logging.warn('no index file were created for %s' % doc_module)
                     continue
 
-            if app.config.create_tarballs:
+            if create_tarball:
                 # another formatting, to ship in tarball
                 cmd = ['xsltproc', '--output', os.path.join(temporary_tarball_dir, lang) + '/',
                         '--nonet', '--xinclude',
@@ -948,7 +951,7 @@
                         os.makedirs(os.path.split(dst)[0])
                     open(dst, 'w').write(open(src, 'r').read())
 
-                    if app.config.create_tarballs:
+                    if create_tarball:
                         # for tarball, adds symlink, it will be followed when
                         # creating the tarball
                         dst = os.path.join(temporary_tarball_dir, lang, doc_figure)
@@ -975,11 +978,11 @@
                 except OSError:
                     logging.warn('failed to create symlink to index file for module %s' % doc_module)
 
-                if app.config.create_tarballs:
+                if create_tarball:
                     dst = os.path.join(temporary_tarball_dir, lang, 'index.html')
                     os.symlink('%s.html' % html_index_file, dst)
 
-            if app.config.create_tarballs:
+            if create_tarball:
                 # also copy some static files from data/skin/
                 for filename in os.listdir(os.path.join(data_dir, 'skin')):
                     if not (filename.startswith('nav-') or filename.startswith('admon-')):
@@ -988,10 +991,9 @@
                     dst = os.path.join(temporary_tarball_dir, lang, os.path.basename(filename))
                     os.symlink(os.path.abspath(src), dst)
 
-        else:
-            if app.config.create_tarballs:
-                self.create_tarball(doc, temporary_tarball_dir, tarball_filepath)
-                self.create_tarball_symlink(doc)
+        if create_tarball:
+            self.create_tarball(doc, temporary_tarball_dir, tarball_filepath)
+            self.create_tarball_symlink(doc)
 
         if app.config.create_tarballs:
             shutil.rmtree(temporary_tarball_dir)



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