gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 47655 - in gump/trunk/python/gump: document/xdocs syndication test update
Date Fri, 01 Oct 2004 17:51:17 GMT
Author: ajack
Date: Fri Oct  1 10:51:16 2004
New Revision: 47655

Modified:
   gump/trunk/python/gump/document/xdocs/documenter.py
   gump/trunk/python/gump/document/xdocs/resolver.py
   gump/trunk/python/gump/syndication/abstract.py
   gump/trunk/python/gump/test/   (props changed)
   gump/trunk/python/gump/update/svn.py
Log:
Some link fixes (icons in RSS|Atom) added RSS|Atom|RDF links to modules/projects.

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	Fri Oct  1 10:51:16 2004
@@ -277,26 +277,9 @@
         definitionTable.createEntry('Gump Run (Hex) GUID', self.run.getRunHexGuid())
         definitionTable.createEntry('Gump Version', setting.VERSION)
         
-        rssSyndRow=definitionTable.createRow()
-        rssSyndRow.createData().createStrong('Syndication')
-        rssArea=rssSyndRow.createData()
-        rssArea.createFork('rss.xml','RSS')
-        rssUrl=self.resolver.getUrl(self.workspace,'rss','.xml')
-        rssArea.createFork('http://www.feedvalidator.org/check.cgi?url=' + rssUrl) \
-                .createIcon(self.resolver.getImageUrl('valid-rss.png'), alt='[Valid RSS]')
#, title='Validate my RSS feed', width='88', height='31')
-                 
-        atomSyndRow=definitionTable.createRow()
-        atomSyndRow.createData().createStrong('Syndication')
-        atomArea=atomSyndRow.createData()
-        atomArea.createFork('atom.xml','Atom')
-        atomUrl=self.resolver.getUrl(self.workspace,'atom','.xml')
-        atomArea.createFork('http://www.feedvalidator.org/check.cgi?url=' + atomUrl) \
-                .createIcon(self.resolver.getImageUrl('valid-atom.png'), alt='[Valid Atom]')
#, title='Validate my Atom feed', width='88', height='31')
+        # RSS|Atom|RDF
+        self.documentXMLLinks(document, definitionTable, depth=getDepthForObject(self.workspace))
      
         
-        rdfSyndRow=definitionTable.createRow()
-        rdfSyndRow.createData().createStrong('Metadata')
-        rdfArea=rdfSyndRow.createData()
-        rdfArea.createFork('gump.rdf','RDF')
         #rdfUrl=self.resolver.getUrl(self.workspace,'gump','.rdf')
         #rdfArea.createFork('http://www.feedvalidator.org/check.cgi?url=' + rdfUrl) \
         #        .createIcon(self.resolver.getImageUrl('valid-rdf.png'), alt='[Valid Atom]')
#, title='Validate my Atom feed', width='88', height='31')
@@ -391,6 +374,37 @@
      
         document.serialize()    
         document=None
+       
+    def documentXMLLinks(self, document=None, table=None, rdf=True, depth=0):
+        """
+        
+        Show RSS|Atom|RDF.
+                
+        """
+        if not table:
+            table=document.createTable(['XML Description','Links'])
+            
+        rssSyndRow=table.createRow()
+        rssSyndRow.createData().createStrong('RSS Syndication')
+        rssArea=rssSyndRow.createData()
+        rssArea.createFork('rss.xml','RSS')
+        rssUrl=self.resolver.getUrl(self.workspace,'rss','.xml')
+        rssArea.createFork('http://www.feedvalidator.org/check.cgi?url=' + rssUrl) \
+                .createIcon(self.resolver.getImageUrl('valid-rss.png',depth), alt='[Valid
RSS]') #, title='Validate my RSS feed', width='88', height='31')
+                 
+        atomSyndRow=table.createRow()
+        atomSyndRow.createData().createStrong('Atom Syndication')
+        atomArea=atomSyndRow.createData()
+        atomArea.createFork('atom.xml','Atom')
+        atomUrl=self.resolver.getUrl(self.workspace,'atom','.xml')
+        atomArea.createFork('http://www.feedvalidator.org/check.cgi?url=' + atomUrl) \
+                .createIcon(self.resolver.getImageUrl('valid-atom.png',depth), alt='[Valid
Atom]') #, title='Validate my Atom feed', width='88', height='31')
+        
+        if rdf:
+            rdfRow=table.createRow()
+            rdfRow.createData().createStrong('RDF Metadata')
+            rdfArea=rdfRow.createData()
+            rdfArea.createFork('gump.rdf','RDF')
         
     def documentPartial(self,node):
             notice=node.createWarning()
@@ -1521,6 +1535,9 @@
         if metadataLocation and metadataUrl:  
             descriptionSection.createParagraph('Gump Metadata: ').createFork(metadataUrl,
metadataLocation)
             
+        # RSS|Atom
+        self.documentXMLLinks(document,None,False, depth=getDepthForObject(module))
+        
         if module.cause and not module==module.cause:
              self.insertTypedLink( module.cause, module, \
                  document.createNote( "This module failed due to: "))     
@@ -1759,7 +1776,10 @@
         metadataUrl=project.getMetadataViewUrl()
         if metadataLocation and metadataUrl:  
             detailsList.createEntry('Gump Metadata: ').createFork(metadataUrl, metadataLocation)
-                             
+        
+        # RSS|Atom|RDF
+        self.documentXMLLinks(document, depth=getDepthForObject(project))
+        
         self.documentStats(document,project,realTime)
                 
         self.documentFileList(document,project,'Project-level Files')  

Modified: gump/trunk/python/gump/document/xdocs/resolver.py
==============================================================================
--- gump/trunk/python/gump/document/xdocs/resolver.py	(original)
+++ gump/trunk/python/gump/document/xdocs/resolver.py	Fri Oct  1 10:51:16 2004
@@ -284,7 +284,7 @@
             location.setDocument(documentName)
         return concatenateUrl(self.rootUrl,location.serialize()) 
         
-    def getStateIconInformation(self,statePair):
+    def getStateIconInformation(self,statePair,depth=0):
         """
         	Get the URL (and ALT description) for a state pair
         """
@@ -299,7 +299,7 @@
         
         # Build the URL to the icon
         iconName=gumpSafeName(lower(replace(sname,' ','_')))
-        url = self.getIconUrl(iconName+'.png')
+        url = self.getIconUrl(iconName+'.png',depth)
         
         return (url, description)
         

Modified: gump/trunk/python/gump/syndication/abstract.py
==============================================================================
--- gump/trunk/python/gump/syndication/abstract.py	(original)
+++ gump/trunk/python/gump/syndication/abstract.py	Fri Oct  1 10:51:16 2004
@@ -29,6 +29,7 @@
 from gump.model.state import *
 from gump.model.project import ProjectStatistics
 
+from gump.document.xdocs.resolver import getDepthForObject
 
 class AbstractSyndicator(RunSpecific):
     def __init__(self,run):
@@ -70,7 +71,7 @@
         
         content='<p>Project ' + project.getName()  + ', '
                                 
-        content += self.getStateContent(project.getStatePair())
+        content += self.getStateContent(project.getStatePair(), getDepthForObject(project))
                         
         content += 'Duration in state: <b>' + `stats.sequenceInState` + '</b>
(runs) '
         
@@ -104,7 +105,7 @@
         
         content='<p>Module ' + module.getName() + ', '
                                     
-        content += self.getStateContent(module.getStatePair())
+        content += self.getStateContent(module.getStatePair(), getDepthForObject(module))
         
         content += 'Duration in state: <b>' + `stats.sequenceInState`  + '</b>
(runs)'
                         
@@ -125,7 +126,7 @@
                 
         return content
 
-    def getStateContent(self,statePair):
+    def getStateContent(self,statePair,depth=0):
         """
             Construct the generic (HTML) contents for state
         """    
@@ -139,7 +140,7 @@
                 + statePair.getReasonDescription()
         
         content += ( '&nbsp;<img src=\'%s\' alt=\'%s\'/>' ) % \
-            resolver.getStateIconInformation(statePair)
+            resolver.getStateIconInformation(statePair,depth)
             
         content += '<br/><br/>'
         
@@ -179,14 +180,13 @@
         
         return content
 
-    #
-    # Only report once per state change
-    # Don't report on prereq failed, or if just came from that
-    # Don't report on packages
-    # Don't report on bogus states (testing)
-    #
     def moduleOughtBeWidelySyndicated(self, module):
-        
+        """
+        Only report once per state change
+    	Don't report on prereq failed, or if just came from that
+    	Don't report on packages
+    	Don't report on bogus states (testing)   
+        """        
         stats=module.getStats()
         
         return stats.sequenceInState == 1	\
@@ -199,14 +199,13 @@
                 stats.previousState == STATE_PREREQ_FAILED ) \
             and not module.isPackaged()       
               
-              
-    #
-    # Only report once per state change
-    # Don't report on prereq failed, or if just came from that
-    # Don't report on packages
-    # Don't report on bogus states (testing)
-    #
     def projectOughtBeWidelySyndicated(self, project):
+        """
+        Only report once per state change
+    	Don't report on prereq failed, or if just came from that
+    	Don't report on packages
+    	Don't report on bogus states (testing)
+        """
         
         stats=project.getStats()
         

Modified: gump/trunk/python/gump/update/svn.py
==============================================================================
--- gump/trunk/python/gump/update/svn.py	(original)
+++ gump/trunk/python/gump/update/svn.py	Fri Oct  1 10:51:16 2004
@@ -196,11 +196,10 @@
         """
             Build the appropriate SVN command for checkout/update
         """
-        
         repository=module.repository
         
-        log.debug("SubVersion  Module Update : " + module.getName() + \
-                       ", Repository Name: " + str(repository.getName()))
+        log.debug("SubVersion Module Update : " + module.getName() + \
+                       ", Repository Name: " + repository.getName())
                                         
         url=module.svn.getRootUrl()
       

Mime
View raw message