Re: [Zope3-Users] session id

2006-01-02 Thread TAHARA Yusei
Hello.

At Mon, 2 Jan 2006 21:48:11 +1100,
Simon Hang wrote:
 How can I use zope session id(client_id) in .pt template? I'm not
 understanding zope's session id management very well.
 Sometime, I can get session id using code like this
 
 span tal:content=python:request.cookies.items()[0][1]/
 
 But strange think is sometimes request object has empty cookie. above code
 will generate errors.
 
 I know I can get session id using a function like below:
 ...
 def SessionData(self):
 return ISession(self.request).client_id
 ...
 
 but is it possible to do this ONLY using a .pt file?

How about make a tales namespace for session api?

Regards,

-- 
Tahara Yusei
[EMAIL PROTECTED]
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] hello!

2006-01-02 Thread Fernando Quintana Hernández
Hi guys:

I've join the list a week ago and I haven't say hello yet, so: 
hello everybody! I hope being contributing in few weeks, (by the moment
I'm just reading doc :-)

Bye,
Nando.
-- 

Fernando Quintana Hernández
 
CodeSyntax - www.codesyntax.com
Azitaingo Industrialdea 3K, E-20600 EIBAR 
Tel: (+34) 943 82 17 80

wget -O - http://nando.trapagaran.org/nando.gpg | gpg --import
Key fingerprint = DAEF FA14 75AC DDC6 9C6D  6681 BB00 BE27 0F7C 89FD

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: session id

2006-01-02 Thread Philipp von Weitershausen
Simon Hang wrote:
 How can I use zope session id(client_id) in .pt template? I'm not
 understanding zope's session id management very well.

What do you need the client id for? It's a detail that shouldn't bother
you when dealing with sessions, at least not in a ZPT.

 Sometime, I can get session id using code like this
 
 span tal:content=python:request.cookies.items()[0][1]/

I would say that this code's behaviour is utterly unpredictable.
Mappings like request.cookies are not required to have an ordering.
Plus, who says that sessions have to use cookies?

 I know I can get session id using a function like below:
 ...
 def SessionData(self):
 return ISession(self.request).client_id
 ...
 
 but is it possible to do this ONLY using a .pt file?

You could do ISession(self.request).client_id in a python: TALES
expression. But I would recommend against it.

I don't think you need the client id in a ZPT. If you do, then perhaps
you should rethink your approach to sessions in your browser views.

Philipp

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Zope 3.2.0b3 released

2006-01-02 Thread Jim Fulton


I've made a source release of Zope 3.2.0 beta 3.  I plan to make a
Windows release tomorrow, when I have access to a windows machine with
a compiler, unless someone beats me to it.

This release was motivated by a fairly severe bug in the input buffering
used to integrate Twisted with Zope.

The release can be downloaded at:

  http://www.zope.org/Products/Zope3/3.2.0b3

I plan to make a final 3.2.0 release on Thursday or Friday.

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: [Zope3-dev] Zope 3.2.0b3 released

2006-01-02 Thread Tim Peters
[Jim Fulton]
 I've made a source release of Zope 3.2.0 beta 3.  I plan to make a
 Windows release tomorrow, when I have access to a windows machine with
 a compiler, unless someone beats me to it.

I gave it a try, but it dies near the start of the process:

$ \python24\python.exe ..\zpkg\bin\zpkg -C releases\Zope.cfg -v
3.2.0b3 -t Zope-win
'version.txt' doesn't match any files in collection
(in C:\Code\Zope3.2\src\zope\app\PACKAGE.cfg)

I _suppose_ this is because there's no file named version.txt in
src/zope/app/ under

svn+ssh://svn.zope.org/repos/main/Zope3/tags/Zope-3.2.0b3

Did you miss step #3 from

http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/MakingARelease

?  Assuming that's all there is to it, I'll add it myself ...
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: [Zope3-dev] Zope 3.2.0b3 released

2006-01-02 Thread Tim Peters
A Windows installer is also available now:

http://www.zope.org/Products/Zope3/3.2.0b3
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: [Zope3-dev] Zope 3.2.0b3 released

2006-01-02 Thread Jim Fulton

Tim Peters wrote:

[Jim Fulton]


I've made a source release of Zope 3.2.0 beta 3.  I plan to make a
Windows release tomorrow, when I have access to a windows machine with
a compiler, unless someone beats me to it.



I gave it a try, but it dies near the start of the process:

$ \python24\python.exe ..\zpkg\bin\zpkg -C releases\Zope.cfg -v
3.2.0b3 -t Zope-win
'version.txt' doesn't match any files in collection
(in C:\Code\Zope3.2\src\zope\app\PACKAGE.cfg)

I _suppose_ this is because there's no file named version.txt in
src/zope/app/ under

svn+ssh://svn.zope.org/repos/main/Zope3/tags/Zope-3.2.0b3

Did you miss step #3 from

http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/MakingARelease

?  Assuming that's all there is to it, I'll add it myself ...


Yes, I followed the step, but I forgot to add the file. Sigh.
The file is actually included in the source tar ball.

Jim


--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Building PDF files using reportlab, with image objects in Zope3

2006-01-02 Thread Adam Summers

Hi,

I'm trying to build a report using zope3 + reportlab 1.20 that I want to 
contain some images from a container (which in the code below is called 
'item').


Has anyone done this? Can they suggest a technique?

Trying the following:
   images = []
   for docpage in item.values():
   f = tempfile.TemporaryFile()
   f.write(docpage.data)
   width, height = docpage.getImageSize()
   images.append( Image(f, width=width, height=height) )


Only gets me as far as an error (when the images list is placed on the 
list containing the document structure):
 File /home/Adam/z3/Zope3/src/zope/component/site.py, line 75, in 
queryMultiAdapter

   default)
 File /home/Adam/z3/Zope3/src/zope/interface/adapter.py, line 475, in 
queryMultiAdapter

   return factory(*objects)
 File /home/Adam/z3/products/ccard/pdf/card.py, line 58, in __init__
   images.append( Image(f, width=width, height=height) )
 File 
/usr/lib/python2.4/site-packages/reportlab/platypus/flowables.py, line 
318, in __init__

   self._setup(width,height,kind,0)
 File 
/usr/lib/python2.4/site-packages/reportlab/platypus/flowables.py, line 
327, in _setup

   if lazy=0: self._setup_inner()
 File 
/usr/lib/python2.4/site-packages/reportlab/platypus/flowables.py, line 
334, in _setup_inner

   if img: self.imageWidth, self.imageHeight = img.getSize()
 File /usr/lib/python2.4/site-packages/reportlab/lib/utils.py, line 
530, in getSize

   if (self._width is None or self._height is None):
AttributeError: ImageReader instance has no attribute '_width'

  Has anyone done what I want to? How? Any help would be much 
appreciated.


Regards,
Adam


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Building PDF files using reportlab, with image objects in Zope3

2006-01-02 Thread Andreas Jung



--On 3. Januar 2006 11:30:25 +0800 Adam Summers [EMAIL PROTECTED] wrote:



530, in getSize
if (self._width is None or self._height is None):
AttributeError: ImageReader instance has no attribute '_width'

   Has anyone done what I want to? How? Any help would be much
appreciated.



Reportlab questions should be asked on the reportlab mailinglist. This is 
basically not a Zope 3 issue.


-aj

pgpDRE2GcsjLv.pgp
Description: PGP signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users