Trac Design Spec Modification
It took me about 3 hours to dig into the Trac code and learn enough Python to hack together a way to create a Design Spec snapshot using Trac. The problem is that we’re using the Trac wiki as our main information warehouse now. We wanted a way to be able to take a page in the wiki and create a snapshot of it to be added to a design specification. That way, at any one release we have a snapshot of the wiki pages that explain everything about it.
Since Trac already takes care of version control, it wasn’t too hard to conceptuallize that we just wanted another wiki page called DesignSpec that would just have a list of links to specific versions of different wiki pages. The design spec itself would then be version controlled as normal and we can just associate software release 0.0.1 with DesignSpec version 45. So, really all we needed was a quick way to add a link to the design spec from all the wiki pages.
I just added another button next to the Edit button that says Add to DesignSpec. The code that does the work is pretty simple:
if addToDS:
self.perm.assert_permission (perm.WIKI_MODIFY)
self.req.hdf.setValue('wiki.action', 'addToDS')
self.DS = WikiPage("DesignSpec", version, self.perm, self.db)
self.DS.set_content(self.DS.text + " * [http://ourIP" + self.env.href.wiki(self.page.name, self.page.version) + " " + self.page.name + "]\n")
self.DS.commit(author, comment, self.req.remote_addr)
self.req.redirect(self.env.href.wiki("DesignSpec"))
I’m just glad we don’t have lines of code watchers out there that for some reason or another equate productivity with how many lines of code you write. It would be hard to justify 7 lines of code taking 3 hours to write.

October 6th, 2005 at 1:39 pm
[…] An Adventure into Industry The True Story of My Adventure Away From Acedemia Into the Dark Work of Industry « Trac Design Spec Modification […]