2 Run this file 'python getstamps.py' from your pyblosxom data-dir.
4 You may need to make some modification for your situation. This
5 assumes your blog entries use a .txt extension.
7 Hacked on by Michael Olson <http://www.mwolson.org/>.
9 __author__
= 'Nathan Kent Bullock'
10 __homepage__
= 'http://bullock.moo.com/nathan/'
11 __email__
= 'nathan_kent_bullock -at- yahoo.ca'
14 import re
, sys
, os
, types
18 DateRegexp
= re
.compile (r
'^#date\s+(.+)$')
22 matched
= DateRegexp
.search(line
)
24 return matched
.group(1)
29 for filename
in os
.listdir(so_far
):
30 filepath
= so_far
+ "/" + filename
32 # just makes output prettier.
33 if filename
== ".svn": continue
35 if os
.path
.isdir(filepath
):
36 print "dir %s" % (filepath
,)
39 # You may need to modify the extension test
40 if os
.path
.isfile(filepath
) and filepath
!= "timestamps":
41 thisfile
= open(filepath
,'r')
42 thisdate
= getdate (thisfile
)
44 OutFile
.write("%s %s\n" % (thisdate
, filepath
[2:] + ".txt"))
47 if __name__
== "__main__":
48 OutFile
= open("timestamps", "w+")