RE: [Zope] error with simple python script loop

2006-11-27 Thread Christian Steinhauer

>>Have you tried what I posted before? I mean try to add to your script:
>>container.REQUEST.RESPONSE.setHeader('content-type', 'text/html')
>>
>>I'm curious if this changes anything.

yes i test this and then the header is everytime 200 OK - so no problem. But
i test this only with my 2 lines of code test script, not with the big
application. Now the IE7 does it better i think, but i must test this next
days. 

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


Re: [Zope] error with simple python script loop

2006-11-27 Thread Dieter Maurer
Chris Withers wrote at 2006-11-27 16:16 +:
> ...
>Moral of the story: if you want sane things to happen, make sure your 
>script returns a string output.

In fact, an empty string would result in the same behaviour.

Thus, the moral should be: make your your script does not return
a Python false value. As returning nothing, means returning "None"
which is a Python false value, this implies, return something.



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


Re: [Zope] error with simple python script loop

2006-11-27 Thread Maciej Wisniowski
> This script is the part of the devil ;) It has produce the double emails, i
> have cut some lines codes to get it faster to understand. 
Have you tried what I posted before? I mean try to add to your script:
container.REQUEST.RESPONSE.setHeader('content-type', 'text/html')

I'm curious if this changes anything.

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


RE: [Zope] error with simple python script loop

2006-11-27 Thread Christian Steinhauer
 
>>>   context.MailHost.send('bodytext', "[EMAIL PROTECTED]",
>>"[EMAIL PROTECTED]",
>>> 'subj'+str(i))
>>> ###
>>> This script produces: HTTP/1.1 204 No Content
>>
>>Moral of the story: if you want sane things to happen, make sure your 
>>script returns a string output.
>>
>>Otherwise you risk tickling some of the more arcane "features" of Zope 
>>2's publisher. They include "no content"
>>responses if you return None and even weirder things if you return a 
>>two-element tuple.
>>
>>This isn't a bug, you're doing something silly, stop doing it ;-)

Here i must add that it is an test script for the list only, the real script
which has produce the error is bigger and it has an output of string. But
the part which is sending the mail has produce the double emails, so i debug
this part. 

Here is a bit of the original script, so tell me again why i get the error,
because it has an string output. 

###
recp_list = []
request.set('Query','SQL SELECT')

for i in context.sql_query():
  mMsg = 'test'
  mTo = str(i["m_to"])
  mFrom = str(i["m_from"])
  mSubj = str(i["l_subject"])
  context.MailHost.send(mMsg, mTo, mFrom, mSubj)
  recp_list.append(i["u_email"])

recp_output = str(recp_list)
mRet = 'E-Mails send to:' + recp_output + ''
return mRet
###

This script is the part of the devil ;) It has produce the double emails, i
have cut some lines codes to get it faster to understand. 

- cs

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


Re: [Zope] error with simple python script loop

2006-11-27 Thread Chris Withers

Christian Steinhauer wrote:

http://www.blunck.se/iehttpheaders/iehttpheaders.html



What a nice tool. Now more debugging with some interesting results. 


###
for i in range(2):
  context.MailHost.send('bodytext', "[EMAIL PROTECTED]", "[EMAIL PROTECTED]",
'subj'+str(i))
###
This script produces: HTTP/1.1 204 No Content


Moral of the story: if you want sane things to happen, make sure your 
script returns a string output.


Otherwise you risk tickling some of the more arcane "features" of Zope 
2's publisher. They include "no content" responses if you return None 
and even weirder things if you return a two-element tuple.


This isn't a bug, you're doing something silly, stop doing it ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] zdb

2006-11-27 Thread Chris Withers

Paul Winkler wrote:

On Fri, Nov 24, 2006 at 02:46:25PM +0100, Christian Steinhauer wrote:
... i cant use pdb on zopeĀ“s python script i think? 


Normally true, but you can google for Chris Withers' "zdb" product
which allows debugging from scripts very nicely.


http://www.simplistix.co.uk/software/zope/zdb

Sadly doesn't work with .cpy's in Plohn...

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Help! Can't Log Into ZMI!!

2006-11-27 Thread Nancy Donnelly
> When you have access to the ssh on your server i think you can set an
> 'master password' 

I couldn't even pull up the ZMI password dialog box. But I figured it out. I 
changed IP addresses and needed to update that in the zope.conf because ZEO 
listens on port . 

I wonder why I can't just use the localhost address: 127.0.0.1 ? Doesn't seem 
to work.
Nancy





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