David Stanek wrote:

On 1/2/06, *Jeremy Jones* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    David Stanek wrote:



    On 1/2/06, *Jeremy Jones* <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:


        I guess I could look at templates/master.py .... oh, that's
        right - it
        doesn't exist.  I just googled and didn't find a flag to turn on
        generation of .py files from Kid.  If someone knows how, I'd
        appreciate
        some insite.  I guess I'm about to dig into kid/__init__.py
        to see if I
        can track down more of what's going on...  Just thought I'd
        take a
        moment to whine while it's fresh on my frustration list.



    There is a couple tickets on better error handling already. So it
    is only a matter of time now. To turn on .py generation just have
    KID_OUTPUT_PY="true" in your server's environment.

    -- David

    OK - I have the .py creation turned on.  Here's the bottom of the
    traceback again:

 File 
"/usr/local/apps/python2.4/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py",
 line 314, in transform
   By default, the `pull` method is called to obtain the stream.
 File "/usr/local/apps/python2.4/lib/python2.4/site-packages/kid-

0.8-py2.4.egg/kid/__init__.py", line 273, in pull
   try:
 File 
"/home/jmjones/svn/home/pppweb/trunk/pppwebproject/tg/pppweb/pppweb/templates/view_cart.py",
 line 19, in initialize
   rslt = initialize(self)


 File 
"/home/jmjones/svn/home/pppweb/trunk/pppwebproject/tg/pppweb/pppweb/templates/master.py",
 line 21, in initialize
   def initialize(self):
TypeError: 'NoneType' object is not callable

    Here is some context around line 21 in my master.py:


         14 def initialize(template): pass
         15 doctype = (u'html', u'-//W3C//DTD XHTML 1.0
    Transitional//EN',
    u'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd')
         16 import sitetemplate
         17 from turbogears import identity
         18 from cherrypy import session
         19 class Template(template_util.get_base_class(sitetemplate,
    __file__),BaseTemplate):
         20     _match_templates = []
         21     def initialize(self):  #<- The exception is happening
    here because it says that it's not callable
         22         rslt = initialize(self)
         23         if rslt != 0: super(Template, self).initialize()

    And here is some context around line 19 in my view_cart.py file:

         13 BaseTemplate = kid.BaseTemplate
         14 def initialize(template): pass
         15 doctype = (u'html', u'-//W3C//DTD XHTML 1.0
    Transitional//EN',
    u'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd')
         16 class Template(template_util.get_base_class('master.kid',
    __file__),BaseTemplate):
         17     _match_templates = []
         18     def initialize(self):
         19         rslt = initialize(self)
         20         if rslt != 0: super(Template, self).initialize()

Any idea what's going on or where I can look to figure this out? It's not consistently happening. It only happens after a certain
    sequence of events, but not always.

    Any help or insight would be greatly appreciated.

    - jmj


Are you possibly using the variable name initialize in the bad cases?

-- David

I just double checked and I don't find any "initialize" variable anywhere in this app. Thx,

- jmj

Reply via email to