[Checkins] SVN: zope.kgs/trunk/src/zope/kgs/site.py The release date is now added to the KGS, if not available.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Jan 27 06:48:18 EST 2009
Log message for revision 95127:
The release date is now added to the KGS, if not available.
Changed:
U zope.kgs/trunk/src/zope/kgs/site.py
-=-
Modified: zope.kgs/trunk/src/zope/kgs/site.py
===================================================================
--- zope.kgs/trunk/src/zope/kgs/site.py 2009-01-27 11:47:02 UTC (rev 95126)
+++ zope.kgs/trunk/src/zope/kgs/site.py 2009-01-27 11:48:18 UTC (rev 95127)
@@ -21,10 +21,12 @@
located to generate the site. The generated site is in that directory as
well.
"""
+import datetime
import docutils.core
import logging
import optparse
import os
+import re
import shutil
import sys
import time
@@ -150,7 +152,10 @@
# Insert date into KGS, if it is not set.
if not set.date:
- pass
+ text = open(kgsPath, 'r').read()
+ pos = re.search('\[KGS\]\n(?:.+\n)*', text).end()
+ text = text[:pos] + 'date = %s\n' %datetime.date.today() + text[pos:]
+ open(kgsPath, 'w').write(text)
# Recreate the KGS
set = kgs.KGS(kgsPath)
More information about the Checkins
mailing list