Discussion:
[Erp5-dev] [BUG] Problem with Base_viewInspectionReport in erp5_xhtml_style
Lukasz Nowak
2006-10-03 07:54:15 UTC
Permalink
Hello,

When developer mode is activated, and Base_viewInspectionReport is invoked on
object, such exception is raised:

Error Type: NameError
Error Value: name 'preferred_html_style_developper_mode' is not defined

After installing erp5_html_style all works fine.

I'd like to patch it, but I think, that that are internals of rendering, which
is not known to me for (at least for now).

Full traceback attached.

Bye,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 392 10 60 int 37 fax: +48 32 392 10 61
https://ssl.ventis.com.pl/keys/lukasz.nowak.pub.asc
``Use the Source, Luke...''
-------------- next part --------------
Traceback (innermost last):

Module ZPublisher.Publish, line 101, in publish
099 | missing_name,
100 | dont_publish_class,
101>| request, bind=1)
102 |
103 | if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 | args=tuple(args)
088>| if debug is not None: return debug(object,args,context)
089 | else: return object(*args)

Module ZPublisher.Publish, line 39, in call_object
037 |
038 |def call_object(object, args, request):
039>| result=apply(object,args) # Type s<cr> to step into published object.
040 | return result
041 |

Module Shared.DC.Scripts.Bindings, line 306, in __call__
304 | def __call__(self, *args, **kw):
305 | '''Calls the script.'''
306>| return self._bindAndExec(args, kw, None)
307 |
308 | def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
341 | exec bindcode
342 | bound_data = bound_data[0]
343>| return self._exec(bound_data, args, kw)
344 | finally:
345 | security.removeContext(self)

Module Products.PythonScripts.PythonScript, line 323, in _exec
321 | f = new.function(fcode, g, None, fadefs)
322 |
323>| result = f(*args, **kw)
324 | if keyset is not None:
325 | # Store the result in the cache.

Module None, line 7, in Base_viewInspectionReport
- <PythonScript at /erp5/Base_viewInspectionReport used for /erp5/organisation_module/12> - Line 7
004 | else:
005 | return "Item %s of %s cannot be documented. Does it exist ?" % (item_id, context.getPath())
006>|return doc.Documentation_view()
007 |
Module Products.ERP5Form.Form, line 362, in __call__
360 |
361 | # Proxy method to PageTemplate
362>| def __call__(self, *args, **kwargs):
363 | if not kwargs.has_key('args'):
364 | kwargs['args'] = args

Module Products.ERP5Form.Form, line 380, in __call__
378 | # different method ids for every field
379 | request = extra_context['request']
380>| return pt.pt_render(extra_context=extra_context)
381 |
382 | def _exec(self, bound_names, args, kw):

Module Products.PageTemplates.PageTemplate, line 96, in pt_render
094 | getEngine().getContext(c),
095 | output,
096>| tal=not source, strictinsert=0)()
097 | return output.getvalue()
098 |

Module TAL.TALInterpreter, line 190, in __call__
188 | assert self.scopeLevel == 0
189 | assert self.i18nContext.parent is None
190>| self.interpret(self.program)
191 | assert self.level == 0
192 | assert self.scopeLevel == 0

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 613, in do_loop_tal
611 | iterator = self.engine.setRepeat(name, expr)
612 | while iterator.next():
613>| self.interpret(block)
614 | bytecode_handlers["loop"] = do_loop
615 |

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 637, in do_condition
635 | def do_condition(self, (condition, block)):
636 | if not self.tal or self.engine.evaluateBoolean(condition):
637>| self.interpret(block)
638 | bytecode_handlers["condition"] = do_condition
639 |

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 671, in do_useMacro
669 | self.pushMacro(macroName, compiledSlots)
670 | prev_source = self.sourceFile
671>| self.interpret(macro)
672 | if self.sourceFile != prev_source:
673 | self.engine.setSourceFile(prev_source)

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 637, in do_condition
635 | def do_condition(self, (condition, block)):
636 | if not self.tal or self.engine.evaluateBoolean(condition):
637>| self.interpret(block)
638 | bytecode_handlers["condition"] = do_condition
639 |

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 613, in do_loop_tal
611 | iterator = self.engine.setRepeat(name, expr)
612 | while iterator.next():
613>| self.interpret(block)
614 | bytecode_handlers["loop"] = do_loop
615 |

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 671, in do_useMacro
669 | self.pushMacro(macroName, compiledSlots)
670 | prev_source = self.sourceFile
671>| self.interpret(macro)
672 | if self.sourceFile != prev_source:
673 | self.engine.setSourceFile(prev_source)

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 637, in do_condition
635 | def do_condition(self, (condition, block)):
636 | if not self.tal or self.engine.evaluateBoolean(condition):
637>| self.interpret(block)
638 | bytecode_handlers["condition"] = do_condition
639 |

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 671, in do_useMacro
669 | self.pushMacro(macroName, compiledSlots)
670 | prev_source = self.sourceFile
671>| self.interpret(macro)
672 | if self.sourceFile != prev_source:
673 | self.engine.setSourceFile(prev_source)

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 409, in do_optTag_tal
407 | self.no_tag(stuff[-2], stuff[-1])
408 | else:
409>| self.do_optTag(stuff)
410 | bytecode_handlers["optTag"] = do_optTag
411 |

Module TAL.TALInterpreter, line 394, in do_optTag
392 | omit=0):
393 | if tag_ns and not self.showtal:
394>| return self.no_tag(start, program)
395 |
396 | self.interpret(start)

Module TAL.TALInterpreter, line 389, in no_tag
387 | self.interpret(start)
388 | self.restoreOutputState(state)
389>| self.interpret(program)
390 |
391 | def do_optTag(self, (name, cexpr, tag_ns, isend, start, program),

Module TAL.TALInterpreter, line 234, in interpret
232 | else:
233 | for (opcode, args) in program:
234>| handlers[opcode](self, args)
235 | finally:
236 | self.level = oldlevel

Module TAL.TALInterpreter, line 636, in do_condition
634 |
635 | def do_condition(self, (condition, block)):
636>| if not self.tal or self.engine.evaluateBoolean(condition):
637 | self.interpret(block)
638 | bytecode_handlers["condition"] = do_condition

Module Products.PageTemplates.TALES, line 221, in evaluate
219 | __traceback_supplement__ = (
220 | TALESTracebackSupplement, self, expression)
221>| return expression(self)
222 |
223 | evaluateValue = evaluate

Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
045 | g = self._bind_used_names(econtext)
046 | g.update(self._globals)
047>| return eval(code, g, {})
048 |
049 |class _SecureModuleImporter:

Module Python expression "preferred_html_style_developper_mode and hasattr(object, 'meta_type')", line 1, in <expression>
NameError: name 'preferred_html_style_developper_mode' is not defined
Pelletier Vincent
2006-10-03 09:41:55 UTC
Permalink
Post by Lukasz Nowak
Error Type: NameError
Error Value: name 'preferred_html_style_developper_mode' is not defined
It's due to a recent optimisation of developper mode. I'll update object
inspector right now.
--
Vincent Pelletier
Lukasz Nowak
2006-10-03 10:26:21 UTC
Permalink
Hello,
Post by Pelletier Vincent
Post by Lukasz Nowak
Error Type: NameError
Error Value: name 'preferred_html_style_developper_mode' is not defined
It's due to a recent optimisation of developper mode. I'll update object
inspector right now.
In revision 10504 it throws:

Error Type: NameError
Error Value: name 'is_web_mode' is not defined

Tail of traceback:

Module Python expression "not is_web_mode and css_list.extend(['%s/%s' %
(here.portal_url.getPortalPath(), x) for x in
here.ERP5XhtmlStyle_getCSSList()])", line 1, in <expression>
NameError: name 'is_web_mode' is not defined

Bye,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 392 10 60 int 37 fax: +48 32 392 10 61
https://ssl.ventis.com.pl/keys/lukasz.nowak.pub.asc
``Use the Source, Luke...''
Loading...