ajack       2004/01/06 15:44:25

  Modified:    python/gump/syndication syndicator.py atom.py
               python/gump/test __init__.py syndicator.py
  Log:
  Some Atom tweaks.
  
  Revision  Changes    Path
  1.9       +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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- syndicator.py     6 Jan 2004 21:35:45 -0000       1.8
  +++ syndicator.py     6 Jan 2004 23:44:25 -0000       1.9
  @@ -214,11 +214,11 @@
           simple=RSSSyndicator()
           simple.syndicate(run)    
       except:
  -        pass
  +        log.error('Failed to generate RSS Feeds', exc_info=1)    
           
       try:
           from gump.syndication.atom import AtomSyndicator
           atom=AtomSyndicator()
           atom.syndicate(run)
       except:
  -        pass
  \ No newline at end of file
  +        log.error('Failed to generate Atom Feeds', exc_info=1)  
  \ No newline at end of file
  
  
  
  1.2       +6 -14     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- atom.py   6 Jan 2004 21:35:45 -0000       1.1
  +++ atom.py   6 Jan 2004 23:44:25 -0000       1.2
  @@ -63,7 +63,7 @@
   """
   
   import os
  -import time
  +from time import strftime, gmtime
   
   from xml.sax.saxutils import escape
   
  @@ -149,12 +149,9 @@
           
           stream = open(self.file,'w')
           
  -        modified='known2bBogus'
  +        modified=time.strftime('%Y-%m-%dT%H:%M:%SZ', gmtime())
           
  -        try:
  -            self.serializeToStream(stream,modified)
  -        except:
  -            pass
  +        self.serializeToStream(stream,modified)
               
           # Close the file.
           stream.close()  
  @@ -194,9 +191,7 @@
                           'Gump : Module ' + escape(module.getName()), \
                           moduleUrl,   \
                           escape(module.getDescription()))
  -                      
  -        datestr=time.strftime('%Y-%m-%d')
  -        timestr=time.strftime('%H:%M:%S')
  +                    
            
           #           
           # Get a decent description
  @@ -206,7 +201,7 @@
           #
           #
           #
  -        entry=Entry(('%s %s %s') % 
(module.getName(),module.getStateDescription(),datestr), \
  +        entry=Entry(('%s %s') % (module.getName(),module.getStateDescription()), \
                     moduleUrl, \
                     module.getName(), \
                     content)
  @@ -237,9 +232,6 @@
                       'Gump : Project ' + escape(project.getName()),   \
                       projectUrl,      \
                       escape(project.getDescription()))
  -                    
  -        datestr=time.strftime('%Y-%m-%d')
  -        timestr=time.strftime('%H:%M:%S')
            
           #           
           # Get a decent description
  @@ -248,7 +240,7 @@
                           
           #
           #
  -        entry=Entry(('%s %s %s') % 
(project.getName(),project.getStateDescription(),datestr), \
  +        entry=Entry(('%s %s') % (project.getName(),project.getStateDescription()), \
                     projectUrl, \
                     project.getModule().getName() + ":" + project.getName(),   \
                     content )
  
  
  
  1.5       +21 -1     jakarta-gump/python/gump/test/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/__init__.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- __init__.py       21 Nov 2003 19:04:10 -0000      1.4
  +++ __init__.py       6 Jan 2004 23:44:25 -0000       1.5
  @@ -67,6 +67,7 @@
   import gump
   import gump.config
   
  +from gump.model.state import *
   from gump.model.rawmodel import XMLWorkspace
   from gump.model.workspace import Workspace
   
  @@ -94,9 +95,28 @@
       for module in workspace.getModules():        
           listDirectoryAsWork(module,module.getSourceDirectory())
           for project in module.getProjects():
  -            listDirectoryAsWork(project,project.getHomeDirectory())        
  +            listDirectoryAsWork(project,project.getHomeDirectory())     
  +            
  +    # Try to set some statii
  +        
  +    m=0
  +    for module in workspace.getModules():   
  +        m+=1 
  +        if m % 3 == 0:
  +            module.changeState(STATE_FAILED)
  +        else:
  +            module.changeState(STATE_SUCCESS)
  +        p=0
  +        for project in module.getProjects():   
  +            p+=1
  +            if p % 3 == 0:
  +                project.changeState(STATE_FAILED)
  +            else:
  +                project.changeState(STATE_SUCCESS)
   
       return workspace
  +    
  +
       
   def createTestWorkspace():
       xmlworkspace=XMLWorkspace({})
  
  
  
  1.4       +2 -2      jakarta-gump/python/gump/test/syndicator.py
  
  Index: syndicator.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/test/syndicator.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- syndicator.py     6 Jan 2004 21:35:46 -0000       1.3
  +++ syndicator.py     6 Jan 2004 23:44:25 -0000       1.4
  @@ -91,6 +91,6 @@
           simple.syndicate(self.run)
           
       def testAtom(self):
  -        simple=AtomSyndicator()
  -        simple.syndicate(self.run)
  +        atom=AtomSyndicator()
  +        atom.syndicate(self.run)
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to