Re: [Zope-dev] Adding resource in z3c.pt

2008-10-14 Thread Binseer N
2008/10/14 Wichert Akkerman <[EMAIL PROTECTED]>

> Previously Binseer N wrote:
> > Hi all,
> > Can anybody tell me how can i add resource by using z3c.pt. i know how
> to
> > add it by using zope.pagetemplate, i tried it and it was working well.
> The
> > following is the code i am working with and it was not working with
> z3c.pt
> >
> >
> > *configure.zcml:-
> >
> > .
> > .
> > * > factory=".resizing_font.form_template"
> > for=".resizing_font.ResizingFont"
> > name="tatr_css_js.form"
> > />   *
> >
> >  * >name="tatr_js"
> >directory="tatr_resource_js"
> >/>  *
> >
> > .
> > .
> > .
> >
> >
> > resizing_font.pt :-
> >
> > **
> > * 
> > > tal:attributes="src
> > context/++resource++tatr_js/jquery-1.2.6.js">
> >
> >   
> >
> >This is a test :)
> >
> >
> > *
>
> Try adding a trailing ; after your TALES expression.
>
> Wichert.
>

>
> --
> Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things.
> http://www.wiggy.net/   It is hard to make things simple.







Thank you   for the reply  Wichert.
   Do you mean i have to add ";" after the  TAL expression  . I tried so
but the result is same .

 Initially i tried with the following code , but it fired the same error

ie  
 tal:attributes="src  context/++resource++tatr_js/jquery-1.2.6.js;">


then i tried with the following
<script type="text/javascript" src="jquery-1.2.6.js"
tal:attributes="src
context++resource++tatr_jsjquery-1.2.6.js";>
   

it fired the error

2008-10-14T11:45:52 ERROR SiteError
http://192.168.0.43:8080/resizing_font.html
Traceback (most recent call last):
  File "/home/z3.4/lib/python/zope/publisher/publish.py", line 133, in
publish
result = publication.callObject(request, obj)
  File "/home/z3.4/lib/python/zope/app/publication/zopepublication.py", line
167, in callObject
return mapply(ob, request.getPositionalArguments(), request)
  File "/home/z3.4/lib/python/zope/publisher/publish.py", line 108, in
mapply
return debug_call(obj, args)
   - __traceback_info__: 
  File "/home/z3.4/lib/python/zope/publisher/publish.py", line 114, in
debug_call
return obj(*args)
  File "/home/z3.4/lib/python/zope/formlib/form.py", line 774, in __call__
return self.render()
  File "/home/z3.4/lib/python/zope/formlib/form.py", line 768, in render
self.form_result = self.template()
  File "/home/z3.4/lib/python/z3c/pt/pagetemplate.py", line 40, in render
return template.render(**parameters)
  File "/home/z3.4/lib/python/chameleon/zpt/template.py", line 51, in render
return super(PageTemplateFile, self).render(**kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 156, in
render
return super(TemplateFile, self).render(**kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 62, in
render
template = self.cook_check(parameters=kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 152, in
cook_check
return Template.cook_check(self, **kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 57, in
cook_check
template = self.cook(parameters=parameters, **kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 138, in cook
template = self.compiler(**kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 46, in
compiler
encoding=self.encoding)
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 517, in
__init__
self.root, parsed_doctype = parser.parse(body)
  File "/home/z3.4/lib/python/chameleon/zpt/language.py", line 250, in parse
root, doctype = super(Parser, self).parse(body)
  File "/home/z3.4/lib/python/chameleon/core/etree.py", line 39, in parse
return parse(body, self.element_mapping)
  File "/home/z3.4/lib/python/chameleon/core/etree.py", line 202, in parse
tree = lxml.etree.parse(StringIO(body), parser)
  File "lxml.etree.pyx", line 2576, in lxml.etree.parse
(src/lxml/lxml.etree.c:22796)
  File "parser.pxi", line 1483, in lxml.etree._parseDocument
(src/lxml/lxml.etree.c:60359)
  File "parser.pxi", line 1511, in lxml.etree._parseMemoryDocument
(src/lxml/lxml.etree.c:60613)
  File "parser.pxi", line 1390, in lxml.etree._parseDoc
(src/lxml/lxml.etree.c:59530)
  File "parser.pxi", line 932, in

[Zope-dev] Adding resource in z3c.pt

2008-10-13 Thread Binseer N
Hi all,
Can anybody tell me how can i add resource by using z3c.pt. i know how to
add it by using zope.pagetemplate, i tried it and it was working well. The
following is the code i am working with and it was not working with z3c.pt


*configure.zcml:-

.
.
*   *

 *  *

.
.
.


resizing_font.pt :-

**
* 
   
   
  
   
   This is a test :)
   

*



resizing_font.py :-

*from z3c.pt.pagetemplate import ViewPageTemplateFile*

*class ResizingFont(FormBase):
template = NamedTemplate('tatr_css_js.form')
form_fields=[]
def __init__(self,context,request):
self.request=request
self.context=context
form_template = NamedTemplateImplementation(
ViewPageTemplateFile('resizing_font.pt'))


*While running with this code i am getting the error

*2008-10-14T06:14:36 ERROR SiteError
http://192.168.0.43:8080/resizing_font.html
Traceback (most recent call last):
  File "/home/z3.4/lib/python/zope/publisher/publish.py", line 133, in
publish
result = publication.callObject(request, obj)
  File "/home/z3.4/lib/python/zope/app/publication/zopepublication.py", line
167, in callObject
return mapply(ob, request.getPositionalArguments(), request)
  File "/home/z3.4/lib/python/zope/publisher/publish.py", line 108, in
mapply
return debug_call(obj, args)
   - __traceback_info__: 
  File "/home/z3.4/lib/python/zope/publisher/publish.py", line 114, in
debug_call
return obj(*args)
  File "/home/z3.4/lib/python/zope/formlib/form.py", line 774, in __call__
return self.render()
  File "/home/z3.4/lib/python/zope/formlib/form.py", line 768, in render
self.form_result = self.template()
  File "/home/z3.4/lib/python/z3c/pt/pagetemplate.py", line 40, in render
return template.render(**parameters)
  File "/home/z3.4/lib/python/chameleon/zpt/template.py", line 51, in render
return super(PageTemplateFile, self).render(**kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 156, in
render
return super(TemplateFile, self).render(**kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 62, in
render
template = self.cook_check(parameters=kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 152, in
cook_check
return Template.cook_check(self, **kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 57, in
cook_check
template = self.cook(parameters=parameters, **kwargs)
  File "/home/z3.4/lib/python/chameleon/core/template.py", line 138, in cook
template = self.compiler(**kwargs)
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 597, in
__call__
self.root.start(stream)
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 438, in
startself.node.visit()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 107, in
visitself.body()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 92, in
body
element.node.visit()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 107, in
visitself.body()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 92, in
body
element.node.visit()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 107, in
visitself.body()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 92, in
body
element.node.visit()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 106, in
visitself.begin()
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 72, in
begin
self.stream.begin(self.serialize())
  File "/home/z3.4/lib/python/chameleon/core/translation.py", line 174, in
serialize
dynamic_attrs = self.dynamic_attributes or ()
  File "/home/z3.4/lib/python/chameleon/zpt/language.py", line 74, in
dynamic_attributes
if self.element.tal_attributes is not None:
  File "/home/z3.4/lib/python/chameleon/core/utils.py", line 52, in get
return f(value)
  File "/home/z3.4/lib/python/chameleon/zpt/expressions.py", line 236, in
definitions
raise e
SyntaxError: Not a valid path-expression.
192.168.0.43 - - [14/Oct/2008:06:14:36 +] "GET /resizing_font.html
HTTP/1.1" 500 84 "http://192.168.0.43:8080/"; "Mozilla/5.0 (X11; U; Linux
i686; en-US; rv:1.8.1.16) Gecko/20080702
Iceweasel/2.0.0.16(Debian-2.0.0.16-0etch1)"


Thanks in advance :)
*

*
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )