gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: gump/python/gump/document forrest.py xdoc.py
Date Fri, 05 Mar 2004 23:42:22 GMT
ajack       2004/03/05 15:42:22

  Modified:    python/gump/model project.py module.py
               python/gump/document forrest.py xdoc.py
  Log:
  Trying to link to the CVS/SVN views of source, and descriptor
  
  Revision  Changes    Path
  1.60      +16 -4     gump/python/gump/model/project.py
  
  Index: project.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/project.py,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- project.py	4 Mar 2004 17:26:08 -0000	1.59
  +++ project.py	5 Mar 2004 23:42:22 -0000	1.60
  @@ -273,7 +273,19 @@
       def getMetadataLocation(self):
           if self.xml.href and str(self.xml.href): return self.xml.href
           return self.getModule().getMetadataLocation()
  -        
  +                     
  +    def getMetadataViewUrl(self):
  +        if self.xml.href and str(self.xml.href):
  +            location=str(self.xml.href)
  +            if location.startswith('http'): return location
  +            # :TODO: Make configurable
  +            return 'http://cvs.apache.org/viewcvs.cgi/gump/' + location
  +        return self.getModule().getMetadataViewUrl()
  +                        
  +    def getViewUrl(self):
  +        # :TODO: if a basedir the offset?
  +        return self.getModule().getViewUrl()
  +            
       def addJar(self,jar):
           self.jars[jar.getName()]=jar
           
  
  
  
  1.36      +30 -6     gump/python/gump/model/module.py
  
  Index: module.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/module.py,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- module.py	4 Mar 2004 17:26:08 -0000	1.35
  +++ module.py	5 Mar 2004 23:42:22 -0000	1.36
  @@ -90,7 +90,7 @@
           root=':' + str(self.repository.getMethod()) + ':'
           # Add the user (if set)
           if self.repository.hasUser(): root+=str(self.repository.getUser())
  -        # Forge the hostname
  +        # Craft the hostname
           if self.repository.hasHostname():
               root+='@'
               if self.hostPrefix: root+=self.hostPrefix+'.'      
  @@ -101,7 +101,7 @@
                   root+='2401'
           root+=str(self.repository.getPath())
           
  -        # If a subdirect
  +        # If a subdirectory
           if self.dir: root+='/'+str(self.dir)
   
           return root
  @@ -134,6 +134,15 @@
       def getModule(self):
           return str(self.module)
            
  +    def getViewUrl(self):
  +        url=None
  +        if self.repository.hasCvsWeb():
  +            if self.dir and str(self.dir):
  +                 url=self.repostory.getCvsWeb()+'/'+str(self.dir)+'/'
  +            else:
  +                 url=self.module.getName()+'/'+str(self.dir)+'/'
  +        return url
  +        
   class ModuleSvn(ModelObject):
       def __init__(self,xml,repository):
           ModelObject.__init__(self,xml)
  @@ -156,6 +165,9 @@
           
       def getDir(self):
           return self.dir
  +        
  +    def getViewUrl(self):
  +        return self.getRootUrl()
            
   class ModuleJars(ModelObject):
       def __init__(self,xml,repository):
  @@ -533,8 +545,14 @@
       
       def getMetadataLocation(self):
           # I think the bogus 'anonymous' module, needs this safety check
  -        if self.xml: return str(self.xml.href)
  +        if self.xml: return str(self.xml.href)        
           
  +    def getMetadataViewUrl(self):
  +        location=self.getMetadataLocation()
  +        if location:
  +            if location.startswith('http'): return location
  +            # :TODO: Make configurable
  +            return 'http://cvs.apache.org/viewcvs.cgi/gump/' + location
           
       def hasCvs(self):
           if hasattr(self,'cvs') and self.cvs: return 1
  @@ -560,6 +578,12 @@
           
       def getRepository(self):
           return self.repository
  +    
  +    def getViewUrl(self):
  +        if self.hasCvs():
  +            return self.cvs.getViewUrl()
  +        elif self.hasSvn():
  +            return self.svn.getViewUrl()            
           
       def getUpdateCommand(self,exists=0):
           if self.hasCvs():
  
  
  
  1.92      +13 -8     gump/python/gump/document/forrest.py
  
  Index: forrest.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/forrest.py,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- forrest.py	4 Mar 2004 17:26:09 -0000	1.91
  +++ forrest.py	5 Mar 2004 23:42:22 -0000	1.92
  @@ -924,6 +924,11 @@
                   
           descriptionSection.createParagraph().createRaw(description)
   
  +        metadataLocation=module.getMetadataLocation()
  +        metadataUrl=module.getMetadataViewUrl()
  +        if metadataLocation and metadataUrl:  
  +            descriptionSection.createParagraph('Gump Metadata: ').createFork(metadataUrl,
metadataLocation)
  +            
           if module.cause and not module==module.cause:
                self.insertTypedLink( module.cause, module, \
                    document.createNote( "This module failed due to: "))     
  @@ -939,8 +944,7 @@
           if module.cause and not module==module.cause:
                self.insertTypedLink( module.cause, module, stateList.createEntry( "Root Cause:
")) 
                
  -        self.documentAnnotations(document,module)
  -                
  +        self.documentAnnotations(document,module)                
           self.documentServerLinks(document,module,workspace)     
           
           projectsSection=document.createSection('Projects') 
  @@ -1141,8 +1145,9 @@
               document.createWarning('This project does not utilize Gump nagging.')  
                                
           metadataLocation=project.getMetadataLocation()
  -        if metadataLocation:  
  -            detailsList.createEntry('Gump Metadata: ', metadataLocation)
  +        metadataUrl=project.getMetadataViewUrl()
  +        if metadataLocation and metadataUrl:  
  +            detailsList.createEntry('Gump Metadata: ').createFork(metadataUrl, metadataLocation)
                                
           # Note: Leverages previous extraction from project statistics DB
           stats=project.getStats()
  @@ -1504,7 +1509,7 @@
                           # Write out the 'tail'
                           #
                           workSection	\
  -                            .createSection(workTypeName(work.type) + ' : ' + work.command.name)
\
  +                            .createSection('Tail of ' + workTypeName(work.type) + ' : '
+ work.command.name)	\
                               .createSource(tail)
                   
           
  
  
  
  1.16      +6 -4      gump/python/gump/document/xdoc.py
  
  Index: xdoc.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/xdoc.py,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- xdoc.py	3 Mar 2004 22:09:31 -0000	1.15
  +++ xdoc.py	5 Mar 2004 23:42:22 -0000	1.16
  @@ -311,8 +311,10 @@
           return self.storePiece(XDocStrong(self.createSubContext(transient),text))
   
       def createLink(self,href,text=None):
  -        return self.storePiece(XDocLink(self.createSubContext(),href,text))           
  
  +        return self.storePiece(XDocLink(self.createSubContext(),href,text))           
        
           
  +    def createFork(self,href,text=None):
  +        return self.storePiece(XDocFork(self.createSubContext(),href,text))  
         
   class XDocComment(XDocPiece):
       def __init__(self,context,text):
  
  
  

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


Mime
View raw message