You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by aj...@apache.org on 2004/08/23 22:04:33 UTC

svn commit: rev 36778 - in gump/trunk/python: . gump/document/xdocs gump/runner

Author: ajack
Date: Mon Aug 23 13:04:32 2004
New Revision: 36778

Added:
   gump/trunk/python/gump/document/xdocs/synchronizer.py
Modified:
   gump/trunk/python/   (props changed)
   gump/trunk/python/gump/document/xdocs/documenter.py
   gump/trunk/python/gump/runner/runner.py
Log:
Introduced Synchronizer to sync after *both* docs and syndication performed.

Modified: gump/trunk/python/gump/document/xdocs/documenter.py
==============================================================================
--- gump/trunk/python/gump/document/xdocs/documenter.py	(original)
+++ gump/trunk/python/gump/document/xdocs/documenter.py	Mon Aug 23 13:04:32 2004
@@ -105,9 +105,6 @@
         if self.run.getOptions().isOfficial():
             self.documentStatistics()
             self.documentXRef()
-
-        # Synchronize xdocs...
-        return self.syncXDocs()
         
     #####################################################################
     #
@@ -252,35 +249,6 @@
         
         return success
         
-    def syncXDocs(self):
-        
-        # The move contents/xdocs from work directory to log
-        xdocWorkDir=self.getXDocWorkDirectory()
-        logDirectory=self.getXDocLogDirectory()
-        
-        log.info('Synchronize work->log, and clean-up...')
-            
-        success=True
-        try:
-            
-            if self.run.getOptions().isOfficial():
-                # Sync over public pages...
-                syncDirectories(xdocWorkDir,logDirectory)
-            else:
-                # Copy over public pages...
-                copyDirectories(xdocWorkDir,logDirectory)
-            
-            cleanUp=True       
-            if cleanUp:
-                # Clean-up work area
-                wipeDirectoryTree(xdocWorkDir)
-            
-        except:        
-            log.error('--- Failed to work->log sync and/or clean-up', exc_info=1)
-            success=False
-        
-        return success
-                
     #####################################################################           
     #
     # Workspace Pieces

Added: gump/trunk/python/gump/document/xdocs/synchronizer.py
==============================================================================
--- (empty file)
+++ gump/trunk/python/gump/document/xdocs/synchronizer.py	Mon Aug 23 13:04:32 2004
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+
+# Copyright 2003-2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""
+    XDOC generation.
+"""
+
+from gump import log
+
+from gump.utils.tools import syncDirectories,copyDirectories,wipeDirectoryTree
+import gump.run.actor
+    
+class Synchronizer(gump.run.actor.AbstractRunActor):
+    
+    def __init__(self, run, documenter):
+        gump.run.actor.AbstractRunActor.__init__(self, run)            
+        self.documenter=documenter
+ 
+    def synchronizeRun(self):
+    
+        log.debug('--- Synchronize Results')
+
+        # Synchronize xdocs...
+        return self.syncXDocs()
+        
+    def syncXDocs(self):
+        
+        # The move contents/xdocs from work directory to log
+        xdocWorkDir=self.documenter.getXDocWorkDirectory()
+        logDirectory=self.documenter.getXDocLogDirectory()
+        
+        log.info('Synchronize work->log, and clean-up...')
+            
+        success=True
+        try:
+            
+            if self.run.getOptions().isOfficial():
+                # Sync over public pages...
+                syncDirectories(xdocWorkDir,logDirectory)
+            else:
+                # Copy over public pages...
+                copyDirectories(xdocWorkDir,logDirectory)
+            
+            cleanUp=True       
+            if cleanUp:
+                # Clean-up work area
+                wipeDirectoryTree(xdocWorkDir)
+            
+        except:        
+            log.error('--- Failed to work->log sync and/or clean-up', exc_info=1)
+            success=False
+        
+        return success
+   
\ No newline at end of file

Modified: gump/trunk/python/gump/runner/runner.py
==============================================================================
--- gump/trunk/python/gump/runner/runner.py	(original)
+++ gump/trunk/python/gump/runner/runner.py	Mon Aug 23 13:04:32 2004
@@ -29,6 +29,7 @@
 
 from gump.document.text.documenter import TextDocumenter
 from gump.document.xdocs.documenter import XDocDocumenter
+from gump.document.xdocs.synchronizer import Synchronizer
 
 from gump.timing.keeper import TimeKeeper
 from gump.stats.statistician import Statistician
@@ -140,10 +141,12 @@
         
         # Document..
         # Use XDOCS if not overridden...
+        xdocs=False
         documenter=None
         if self.run.getOptions().isText() :
             documenter=TextDocumenter(self.run)
         else:
+            xdocs=True
             documenter=XDocDocumenter(	self.run,	\
                                         self.run.getWorkspace().getBaseDirectory(), \
                                         self.run.getWorkspace().getLogUrl())  
@@ -157,10 +160,15 @@
         # Publish artifacts
         if self.run.getOptions().isPublish():
             self.run.registerActor(RepositoryPublisher(self.run))   
-            
+
+        # Synchonize
+        if xdocs:
+            self.run.registerActor(Synchronizer(self.run,documenter))
+        
         # Notify last
         if self.run.getOptions().isNotify() and self.run.getWorkspace().isNotify():
             self.run.registerActor(Notifier(self.run))         
+                    
                     
         # See what we have...            
         self.run.logActors()

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org