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/08 02:28:11 UTC

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

ajack       2004/01/07 17:28:11

  Modified:    python/gump/syndication syndicator.py atom.py
  Log:
  Tweaks to atom code per feedvalidator.
  
  Revision  Changes    Path
  1.11      +2 -2      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- syndicator.py	7 Jan 2004 17:47:25 -0000	1.10
  +++ syndicator.py	8 Jan 2004 01:28:11 -0000	1.11
  @@ -95,7 +95,7 @@
           
           stats=project.getStats()
           
  -        content='Project ' + project.getName() 
  +        content='Project ' + project.getName()  + ', '
                                   
           content += self.getStateContent(project.getStatePair())
                           
  @@ -119,7 +119,7 @@
           
           stats=module.getStats()
           
  -        content='Module ' + module.getName()
  +        content='Module ' + module.getName() + ', '
                                       
           content += self.getStateContent(module.getStatePair())
           
  
  
  
  1.5       +17 -5     jakarta-gump/python/gump/syndication/atom.py
  
  Index: atom.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/syndication/atom.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- atom.py	7 Jan 2004 18:57:00 -0000	1.4
  +++ atom.py	8 Jan 2004 01:28:11 -0000	1.5
  @@ -95,18 +95,24 @@
           self.description=description        
           self.content=content
        
  -    def serializeToStream(self, stream, modified):
  +    def serializeToStream(self, stream, modified, uri, id):
           
           # Write the header part...
           stream.write("""		<entry>
  +        <author>Gump</author>
  +        <id>tag:gump:%s:%s-%s</id>
           <title>%s</title>
           <link rel="alternate" type="text/html" href="%s"/>
  +        <issued>%s</issued>        
           <modified>%s</modified>        
           """	\
  -        % (self.description, self.link, modified) )
  +        % (	    uri, modified, id, \
  +                self.link, \
  +                self.description, \
  +                modified, modified) )
   
           if self.content:
  -            stream.write("""<content>%s</content>"""	\
  +            stream.write("""<content type='text/html'>%s</content>"""	\
               % (escape(self.content)) )
               
           # Write the trailer part...
  @@ -114,9 +120,10 @@
           
   class AtomFeed:
       
  -    def __init__(self,url,file,title,link,description):
  +    def __init__(self,url,file,uri,title,link,description):
           self.url=url
           self.file=file
  +        self.uri=uri
           self.title=title
           self.link=link
           self.description=description
  @@ -136,8 +143,10 @@
           <modified>%s</modified>        
   """	% (self.description, self.link, modified) )
           
  +        id=0
           for entry in self.entries:
  -            entry.serializeToStream(stream, modified)
  +            entry.serializeToStream(stream, modified, self.uri, id)
  +            id+=1
           
           # Write the trailer part...
           stream.write("""
  @@ -170,6 +179,7 @@
           feedUrl=self.run.getOptions().getResolver().getUrl(self.workspace,'index','.atom')
       
           self.feed=AtomFeed(feedUrl,feedFile,	\
  +                        'workspace',	\
                          'Jakarta Gump',		\
                           self.workspace.logurl,	\
                           """Life is like a box of chocolates""")
  @@ -188,6 +198,7 @@
           moduleUrl=self.run.getOptions().getResolver().getUrl(module)
           
           moduleFeed=AtomFeed(feedUrl,feedFile,	
  +                        'module',	\
                           'Gump : Module ' + escape(module.getName()),	\
                           moduleUrl,	\
                           escape(module.getDescription()))
  @@ -229,6 +240,7 @@
           projectUrl=self.run.getOptions().getResolver().getUrl(project)
           
           projectFeed=AtomFeed(feedUrl, feedFile,	\
  +                        'project',	\
                       'Gump : Project ' + escape(project.getName()),	\
                       projectUrl,	\
                       escape(project.getDescription()))