From: Jonathan E. <jon...@ca...> - 2007-04-26 22:00:25
|
On Thu, 26 Apr 2007 17:49:06 -0400, "Philip Semanchuk" <ph...@se...> said: > So now I have a working module called HeaderModule.py. It looks like > this: > > import spyceModule > import time > > class HeaderModule(spyceModule.spyceModulePlus): > def start(self): > self.modules.response.setContentType("text/html; charset=utf-8") > file("/tmp/ResponseStart.txt", "w").write(time.asctime()) > > When I add [[.import name= HeaderModule]] to the top of a .spy file, my > content-type header gets sent and the timestamp in the /tmp file is > updated, so I know that the module works. > > I still can't get it to work automatically, though. You mentioned a > globalmodules option and I can't find reference to that anywhere in the > code or documentation. Adding HeaderModule to the globals in > spyceconf.py doesn't seem to do the trick. What am I missing? you updated to the latest 2.2 branch? there should be a line in spyceconf.py that says globalmodules = [] so in your config.py you can write globalmodules.append('HeaderModule') |