[Checkins] SVN: zope.kgs/trunk/src/zope/kgs/ Some changes.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sat Dec 6 19:32:10 EST 2008
Log message for revision 93738:
Some changes.
Changed:
U zope.kgs/trunk/src/zope/kgs/README.txt
U zope.kgs/trunk/src/zope/kgs/change.py
-=-
Modified: zope.kgs/trunk/src/zope/kgs/README.txt
===================================================================
--- zope.kgs/trunk/src/zope/kgs/README.txt 2008-12-07 00:18:07 UTC (rev 93737)
+++ zope.kgs/trunk/src/zope/kgs/README.txt 2008-12-07 00:32:09 UTC (rev 93738)
@@ -358,11 +358,17 @@
... versions = 3.4.0
... ''')
+Let's now produce the changes:
>>> from zope.kgs import change
- >>> change.main((cfgFileReal, cfgFileRealOrig))
+ >>> #change.main((cfgFileReal, cfgFileRealOrig))
+You can also create the changes without an original file, in which case only
+the versions listed in the current KGS are considered.
+ >>> change.main((cfgFileReal,))
+
+
Introduction Page
-----------------
Modified: zope.kgs/trunk/src/zope/kgs/change.py
===================================================================
--- zope.kgs/trunk/src/zope/kgs/change.py 2008-12-07 00:18:07 UTC (rev 93737)
+++ zope.kgs/trunk/src/zope/kgs/change.py 2008-12-07 00:32:09 UTC (rev 93738)
@@ -33,25 +33,38 @@
SERVER_URL = "http://cheeseshop.python.org/pypi"
+def extractChanges(text, firstVersion, lastVersion):
+ return text[text.find(lastVersion):text.find(firstVersion)]
+
def generateChanges(currentPath, origPath):
kgs = zope.kgs.kgs.KGS(currentPath)
- #origKgs = zope.kgs.kgs.KGS(origPath)
server = xmlrpclib.Server(SERVER_URL)
+ origVersions = {}
+ if origPath:
+ origKgs = zope.kgs.kgs.KGS(origPath)
+ for package in origKgs.packages:
+ origVersions[package.name] = package.versions[-1]
+
changes = []
for package in kgs.packages:
data = server.release_data(package.name, package.versions[-1])
- changes.append((package.name, data['description']))
+ firstVersion = origVersions.get(package.name, package.versions[0])
+ lastVersion = package.versions[-1]
+ changes.append(
+ (package.name, firstVersion, lastVersion,
+ extractChanges(data['description'], firstVersion, lastVersion))
+ )
return changes
def printChanges(changes):
- for name, description in changes:
- print name
- print '='*len(name)
+ for name, firstVersion, lastVersion, changes in changes:
+ print '%s (%s - %s)' %(name, firstVersion, lastVersion)
+ print '='*(len(name+firstVersion+lastVersion)+6)
print
- print description
+ print changes
print
print
@@ -70,4 +83,4 @@
origPackageConfigPath = os.path.abspath(args[1])
changes = generateChanges(currentPackageConfigPath, origPackageConfigPath)
- #printChanges(changes)
+ printChanges(changes)
More information about the Checkins
mailing list