ajack 2004/01/07 10:57:00
Modified: python/gump/syndication rss.py atom.py
python/gump/test __init__.py syndicator.py
Log:
Some minor tweaks, and (as best my coverage can tell) it looks like it works again...
Revision Changes Path
1.13 +10 -7 jakarta-gump/python/gump/syndication/rss.py
Index: rss.py
===================================================================
RCS file: /home/cvs/jakarta-gump/python/gump/syndication/rss.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- rss.py 7 Jan 2004 18:12:50 -0000 1.12
+++ rss.py 7 Jan 2004 18:57:00 -0000 1.13
@@ -233,8 +233,7 @@
def endRSS(self):
# complete the rss feed
- self.rssStream.write('</rss>\n')
-
+ self.rssStream.write('</rss>\n')
log.info("RSS Newsfeed written to : " + self.rssFile);
def serialize(self):
@@ -318,11 +317,13 @@
('%sT%s%s') % (datestr,timestr,TZ))
# Generate changes, only if the module had changed
- if module.isUpdated() and not module.getStatePair().isUnset():
- moduleRSS.addItem(item)
+ if module.isUpdated() and not module.getStatePair().isUnset():
+ log.info("Add module to RSS Newsfeed for : " + module.getName())
+ moduleRSS.addItem(item)
# State changes that are newsworthy...
- if self.moduleOughtBeWidelySyndicated(module):
+ if self.moduleOughtBeWidelySyndicated(module):
+ log.info("Add module to widely distributed RSS Newsfeed for : " +
module.getName())
mainRSS.addItem(item)
for project in module.getProjects():
@@ -359,12 +360,14 @@
('%sT%s%s') % (datestr,timestr,TZ))
# Generate changes, only if the module changed
- if project.getModule().isUpdated() and not
project.getStatePair().isUnset():
+ if project.getModule().isUpdated() and not
project.getStatePair().isUnset():
+ log.info("Add project to RSS Newsfeed for : " + project.getName())
projectRSS.addItem(item)
moduleRSS.addItem(item)
# State changes that are newsworthy...
- if self.projectOughtBeWidelySyndicated(project) :
+ if self.projectOughtBeWidelySyndicated(project) :
+ log.info("Add project to widely distributed RSS Newsfeed for : " +
project.getName())
mainRSS.addItem(item)
projectRSS.serialize()
1.4 +10 -8 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- atom.py 7 Jan 2004 18:12:50 -0000 1.3
+++ atom.py 7 Jan 2004 18:57:00 -0000 1.4
@@ -124,7 +124,7 @@
self.entries=[]
def addEntry(self,entry):
- self.entries += entry
+ self.entries.append(entry)
def serializeToStream(self, stream, modified):
@@ -199,7 +199,7 @@
content=self.getModuleContent(module,self.run)
#
- #
+ # Entry
#
entry=Entry(('%s %s') % (module.getName(),module.getStateDescription()), \
moduleUrl, \
@@ -207,13 +207,13 @@
content)
# Generate changes, only if the module had changed
- if module.isUpdated():
- if not s.currentState == STATE_NONE and \
- not s.currentState == STATE_UNSET:
- moduleFeed.addEntry(entry)
+ if module.isUpdated() and not module.getStatePair().isUnset():
+ log.info("Add module to Atom Newsfeed for : " + module.getName())
+ moduleFeed.addEntry(entry)
# State changes that are newsworthy...
- if self.moduleOughtBeWidelySyndicated(module):
+ if self.moduleOughtBeWidelySyndicated(module):
+ log.info("Add module to widely distributed Atom Newsfeed for : " +
module.getName())
mainFeed.addEntry(entry)
# Syndicate each project
@@ -246,12 +246,14 @@
content )
# Generate changes, only if the project changed
- if project.getModule().isUpdated() and not
project.getStatePair().isUnset():
+ if project.getModule().isUpdated() and not
project.getStatePair().isUnset():
+ log.info("Add project to Atom Newsfeed for : " + project.getName())
projectFeed.addEntry(entry)
moduleFeed.addEntry(entry)
# State changes that are newsworthy...
if self.projectOughtBeWidelySyndicated(project) :
+ log.info("Add project to widely distributed Atom Newsfeed for : " +
project.getName())
mainFeed.addEntry(entry)
projectFeed.serialize()
1.6 +12 -3 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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- __init__.py 6 Jan 2004 23:44:25 -0000 1.5
+++ __init__.py 7 Jan 2004 18:57:00 -0000 1.6
@@ -96,18 +96,27 @@
listDirectoryAsWork(module,module.getSourceDirectory())
for project in module.getProjects():
listDirectoryAsWork(project,project.getHomeDirectory())
-
+
+ #
# Try to set some statii
-
+ #
m=0
for module in workspace.getModules():
+ #
+ # Set one in three modules as failed.
+ #
m+=1
if m % 3 == 0:
module.changeState(STATE_FAILED)
else:
+ if m % 2 == 0:
+ module.setUpdated(1)
module.changeState(STATE_SUCCESS)
p=0
- for project in module.getProjects():
+ for project in module.getProjects():
+ #
+ # Set one in three projects as failed.
+ #
p+=1
if p % 3 == 0:
project.changeState(STATE_FAILED)
1.5 +0 -1 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- syndicator.py 6 Jan 2004 23:44:25 -0000 1.4
+++ syndicator.py 7 Jan 2004 18:57:00 -0000 1.5
@@ -68,7 +68,6 @@
from gump import log
import gump.config
from gump.gumprun import GumpRun
-from gump.syndication import syndicate
from gump.syndication.rss import RSSSyndicator
from gump.syndication.atom import AtomSyndicator
from gump.test import getWorkedTestWorkspace
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]