gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: jakarta-gump/python/gump/document forrest.py
Date Tue, 10 Feb 2004 22:48:53 GMT
ajack       2004/02/10 14:48:53

  Modified:    python/gump/model object.py project.py
               python/gump/document forrest.py
  Log:
  Another stab at setting/getting ids (when none set).
  
  Revision  Changes    Path
  1.16      +7 -5      jakarta-gump/python/gump/model/object.py
  
  Index: object.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/object.py,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- object.py	10 Feb 2004 20:18:40 -0000	1.15
  +++ object.py	10 Feb 2004 22:48:52 -0000	1.16
  @@ -286,6 +286,8 @@
       def __init__(self,xml,owner):
       	NamedModelObject.__init__(self,xml.getName(),xml,owner)
       	
  +    	self.id = self.xml.id
  +    	
       def setPath(self,path):
           self.path=path
       
  @@ -293,14 +295,14 @@
           return self.path;
           
       def hasId(self):
  -        if self.xml.id: return 1
  +        if self.id: return 1
           return 0
           
       def setId(self,id):
           self.id = id
           
       def getId(self):
  -        return self.xml.id
  +        return self.id
           
       def getType(self):
           return self.xml.type
  
  
  
  1.45      +7 -4      jakarta-gump/python/gump/model/project.py
  
  Index: project.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/project.py,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- project.py	10 Feb 2004 21:07:00 -0000	1.44
  +++ project.py	10 Feb 2004 22:48:53 -0000	1.45
  @@ -488,6 +488,7 @@
           if self.hasJars():
               if 1 == self.getJarCount():
                   if not self.getJarAt(0).hasId():
  +                    self.addInfo('Set <jar identifier to project name')
                       self.getJarAt(0).setId(self.getName())    
               else:
                   #
  @@ -496,7 +497,9 @@
                   #
                   for jar in self.getJars():
                       if not jar.hasId():
  -                        jar.setId(os.path.basename(jar.getPath()))
  +                        basename=os.path.basename(jar.getPath())
  +                        self.addWarning('Set <jar [' + jar.getPath() + '] identifier
to jar basename: [' + basename + ']')    
  +                        jar.setId(basename)
           
           # Grab all the work
           for w in self.xml.work:
  
  
  
  1.71      +33 -28    jakarta-gump/python/gump/document/forrest.py
  
  Index: forrest.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document/forrest.py,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- forrest.py	10 Feb 2004 20:53:39 -0000	1.70
  +++ forrest.py	10 Feb 2004 22:48:53 -0000	1.71
  @@ -249,8 +249,7 @@
           
           document=XDocDocument('Workspace',	\
                   self.resolver.getFile(workspace))    
  -         
  -                    
  +        
           definitionSection=document.createSection('Workspace Definition')    
           
           definitionSection.createNote('This install runs Python Gump, not Traditional Gump.')

  @@ -1136,18 +1135,20 @@
           
           dependencySection=document.createSection('Dependency')
           
  -        self.documentDependenciesList(dependencySection, "Project Dependencies",	\
  +        deps = self.documentDependenciesList(dependencySection, "Project Dependencies",
\
                       project.getDependencies(), 0, project)
                       
  -        self.documentDependenciesList(dependencySection, "Project Dependees",		\
  +        deps += self.documentDependenciesList(dependencySection, "Project Dependees",	
\
                       project.getDependees(), 1, project)
                       
  -        self.documentDependenciesList(dependencySection, "Full Project Dependencies",	\
  +        deps += self.documentDependenciesList(dependencySection, "Full Project Dependencies",
\
                       project.getFullDependencies(), 0, project)
                                                   
  -        self.documentDependenciesList(dependencySection, "Full Project Dependees",		\
  +        deps += self.documentDependenciesList(dependencySection, "Full Project Dependees",
	\
                       project.getFullDependees(), 1, project)
           
  +        if not deps:
  +            dependencySection.createParagraph('No dependency information available.')
           
           document.serialize()
           
  @@ -1204,11 +1205,12 @@
           if not paths:        
               pathTable.createLine('No ' + title + ' entries')
                        
  -    def documentDependenciesList(self,xdocNode,title,dependencies,dependees,referencingObject):
  -      if dependencies:
  +    def documentDependenciesList(self,xdocNode,title,dependencies,dependees,referencingObject):
       
  +        totalDeps=0
  +                
  +        if dependencies:
               dependencySection=xdocNode.createSection(title)
               dependencyTable=dependencySection.createTable(['Name','Type','Inheritence','Ids','State','Notes'])
  -            totalDeps=0
               for depend in dependencies:
                   
                   totalDeps += 1
  @@ -1244,12 +1246,17 @@
                   
                   # Dependency Annotations
                   noteData=dependencyRow.createData()
  -                for note in depend.getAnnotations():
  -                    noteData.createText(str(note))
  -                    noteData.createBreak()                    
  +                if depend.getAnnotations():
  +                    for note in depend.getAnnotations():
  +                        noteData.createText(str(note))
  +                        noteData.createBreak()                    
  +                else:
  +                    noteData.createText('')
           
               dependencySection.createParagraph(
                       'Total ' + title + ' : ' + str(totalDeps))
  +                    
  +        return totalDeps            
                   
       def documentAnnotations(self,xdocNode,annotatable):
           
  @@ -1275,22 +1282,20 @@
           servers=workspace.getServers()
           if not servers: return        
           
  -        links=[]
  -        for server in servers:
  -            if server.hasResolver():
  -                link=server.getResolver().getUrl(linkable)
  -                if link:
  -                    links.append(server)
  -                
  -        if not links: return
  -        
           serversSection=xdocNode.createSection('Servers')        
           serversTable=serversSection.createTable()
           serverRow=serversTable.createRow()
  -        for server in links:      
  -            serverRow.createData().createFork(	\
  -                    server.getResolver().getUrl(linkable), \
  -                    server.getName() )
  +        for server in servers: 
  +            if server.hasResolver():
  +                serverRow.createData().createFork(	\
  +                        server.getResolver().getUrl(linkable), \
  +                        server.getName() )
  +            else:
  +                if server.hasUrl():
  +                    serverRow.createData().createFork(	\
  +                            server.getUrl(), \
  +                            server.getName() )    
  +                
                           
       def documentProperties(self,xdocNode,propertyContainer,title='Properties'):
           
  
  
  

Mime
View raw message