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/01/15 20:42:24 UTC

cvs commit: jakarta-gump/python/gump/syndication syndicator.py

ajack       2004/01/15 11:42:24

  Modified:    python/gump/output statsdb.py
               python/gump/syndication syndicator.py
  Log:
  1) Fixed HTML embeded in RSS/Atom, making it valid HTML.
  2) Added description to the module/project syndication info, 
  for services like PlanetApache (i.e. becomes more meaningful standalone data).
  
  Revision  Changes    Path
  1.12      +5 -19     jakarta-gump/python/gump/output/statsdb.py
  
  Index: statsdb.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/output/statsdb.py,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- statsdb.py	9 Jan 2004 23:46:53 -0000	1.11
  +++ statsdb.py	15 Jan 2004 19:42:24 -0000	1.12
  @@ -410,14 +410,7 @@
   def compareModulesByFOGFactor(module1,module2):
       fog1=module1.getFOGFactor()
       fog2=module2.getFOGFactor()
  -    c= int(round(fog2 - fog1,0))                  
  -    if not c: c=cmp(module1,module2)
  -    return c             
  -            
  -def compareModulesByFOGFactor(module1,module2):
  -    fog1=module1.getFOGFactor()
  -    fog2=module2.getFOGFactor()
  -    c= int(round(fog2 - fog1,0))                  
  +    c= int(round(fog2 - fog1,2))                  
       if not c: c=cmp(module1,module2)
       return c             
               
  @@ -459,14 +452,7 @@
   def compareProjectsByFOGFactor(project1,project2):
       fog1=project1.getFOGFactor()
       fog2=project2.getFOGFactor()
  -    c= int(round(fog2 - fog1,0))                  
  -    if not c: c=cmp(project1,project2)
  -    return c             
  -            
  -def compareProjectsByFOGFactor(project1,project2):
  -    fog1=project1.getFOGFactor()
  -    fog2=project2.getFOGFactor()
  -    c= int(round(fog2 - fog1,0))                  
  +    c= int(round(fog2 - fog1,2))                  
       if not c: c=cmp(project1,project2)
       return c             
               
  
  
  
  1.14      +29 -12    jakarta-gump/python/gump/syndication/syndicator.py
  
  Index: syndicator.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/syndication/syndicator.py,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- syndicator.py	11 Jan 2004 18:42:32 -0000	1.13
  +++ syndicator.py	15 Jan 2004 19:42:24 -0000	1.14
  @@ -95,7 +95,7 @@
           
           stats=project.getStats()
           
  -        content='Project ' + project.getName()  + ', '
  +        content='<p>Project ' + project.getName()  + ', '
                                   
           content += self.getStateContent(project.getStatePair())
                           
  @@ -105,8 +105,18 @@
               and not stats.previousState == STATE_UNSET:
               content += 'Previous state: <b>' \
                                       + stateName(stats.previousState)  \
  -                                    + '</b>\n\n'
  +                                    + '</b>'
       
  +        content += '</p>'
  +        
  +        if project.hasDescription or module.hasDescription():
  +            content+='<p>'           
  +            if project.hasDescription(): 
  +                content+=project.getDescription()
  +            else:
  +                content+=module.getDescription()
  +            content+='<p>'
  +            
           content += self.getSundries(project)
                   
           return content
  @@ -119,18 +129,25 @@
           
           stats=module.getStats()
           
  -        content='Module ' + module.getName() + ', '
  +        content='<p>Module ' + module.getName() + ', '
                                       
           content += self.getStateContent(module.getStatePair())
           
  -        content += 'Sequence in state: ' + `stats.sequenceInState`
  +        content += 'Duration in state: <b>' + `stats.sequenceInState`  + '</b> (runs), '
                           
           if not stats.previousState == STATE_NONE \
               and not stats.previousState == STATE_UNSET:
  -            content += 'Previous state: ' \
  -                                    + stateName(stats.previousState)  \
  -                                    + '\n\n'
  +            content += 'Previous state: <b>' \
  +                                    + stateName(stats.previousState) \
  +                                    + '</b>'
  +                                    
  +        content += '</p>'
       
  +        if module.hasDescription():
  +            content+='<p>'            
  +            content+=module.getDescription()
  +            content+='<p>'
  +            
           content += self.getSundries(module)
                   
           return content
  @@ -148,7 +165,7 @@
           content += ( '&nbsp;<img src=\'%s\' alt=\'%s\'/>' ) % \
               resolver.getStateIconInformation(statePair)
               
  -        content += '<br><br>'
  +        content += '<br/><br/>'
           
           return content
           
  @@ -175,7 +192,7 @@
                       url + '\'>' + work.getName() + 	\
                       '</a></td><td>' + state + 		\
                       '</td></tr>\n')                   
  -            content += '<table></p>'
  +            content += '</table></p>'
   
   # Overkill           
   #        content += ('<br><hr>\n<img align=\'left\' alt=\'Brought to you by Jakarta Gump\' src=\'%s\'/>') \