Re: [Zope] Python scripts

2012-07-06 Thread Laurence Rowe
On 6 July 2012 14:09, Richard Harley wrote: > On Zope 2.10 is there a simple/universal way to only allow python scripts to > be called by DTML methods or other python scripts and not directly TTW? You can check that the script is not the published object with: if container.REQUEST['PUBLISHED

Re: [Zope] Python scripts

2012-07-06 Thread Richard Harley
That works great, thanks. So there is no way to do this across, say, a folder with hundreds of scripts in without duplicating the code in each individually? On 06/07/12 13:30, Laurence Rowe wrote: On 6 July 2012 14:09, Richard Harley wrote: On Zope 2.10 is there a simple/universal way to on

Re: [Zope] Python scripts

2012-07-06 Thread Laurence Rowe
On 6 July 2012 16:36, Richard Harley wrote: > That works great, thanks. So there is no way to do this across, say, a > folder with hundreds of scripts in without duplicating the code in each > individually? For one Plone hotfix we took the approach of blacklisting certain scripts by monkey-patchi

Re: [Zope] Python Scripts

2005-06-16 Thread J Cameron Cooper
We have been seeing a number of instances where python scripts fail due to an apparent "syntax error" but the syntax is correct and simply storing the method restores it to functionality. Anyone else seeing this? How do you mean "fail"? Often times, if you have an error, save, test, and the

Re: [Zope] Python Scripts

2005-06-16 Thread Greg Fischer
Yeah, I do see that every once in a while. I have a very simple script, that looks perfect, but will always return "syntax error". I copied the text, pasted into a text editor and checked all the indents and tabs, then recreated the script. Problem went away. What was interesting is that I didn

Re: [Zope] Python Scripts

2005-06-17 Thread Dieter Maurer
Dennis Allison wrote at 2005-6-16 09:06 -0700: >We have been seeing a number of instances where python scripts fail due to >an apparent "syntax error" but the syntax is correct and simply storing >the method restores it to functionality. Anyone else seeing this? I saw this today. I expect DOS

Re: [Zope] Python Scripts

2005-07-12 Thread Chris Withers
Dieter Maurer wrote: I saw this today. I expect DOS type line endings. Your browser (or maybe the ":text" converter in ZPublisher) will remove them. Therefore, they disappear when you "store" again. Indeed, but should ZPT Python Scripts really be so sensitive to line endings? Chris -- Si

Re: [Zope] Python Scripts and Versioning

2000-12-13 Thread Chris Withers
Michel Pelletier wrote: > > See, people used to post helpful little things like this in DTML. What a > nightmare. Python Scripts rock! We're gonna be seein' alot more of them > fly by on the list once people get over the initial shock that they can do > 90% of what they've been doing in Python

RE: [Zope] Python Scripts in 2.2.x

2001-01-08 Thread Ron Bickers
I'm running PythonScripts with 2.2.4 and, with one exception, they seem to be working just fine. The exception is that DTML namespace binding does not work under 2.2. You can, however, pass the namespace explicitly to get the same effect. Here is what you need to do to get it working. Note tha

RE: [Zope] Python Scripts in 2.2.x

2001-01-09 Thread Mayers, Philip J
Network Support | | Centre for Computing Services| | Imperial College | +--+ -Original Message- From: Mayers, Philip J Sent: 09 January 2001 10:01 To: 'Bill Anderson' Subject: RE: [Zope] Python Scripts in 2.2.x No, I

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17 Aug 2006, at 14:57, Muk Yan wrote: What my question is, is there anyway to directly access "first_name" from the form in the python script without having to have to call the first_name)> and then REQUEST.SESSION.get('firstName') in the py

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Kirk Strauser
On Thursday 17 August 2006 1:57 pm, Muk Yan wrote: > Name: Make that: > DTML Method, process_this_form: > > > > and in the Python Script, this_is_a_python_script > I use REQUEST.SESSION.get('firstName') Make that: -- Kirk Strauser The Day Companies __

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Kirk Strauser
On Thursday 17 August 2006 2:02 pm, Jens Vagelpohl wrote: > request.get(MY_VARIABLE) ??? The one major problem with that is that it ties you to getting information from the request. Better to write a script with explicit parameters and call it with those parameters. Then, you can pull values

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Jonathan
Form variables are stored in REQUEST. In a python script you gain access to REQUEST by:   REQUEST = container.REQUEST you can then access the form variables by:   fname = REQUEST['first_name']     you can check for the presence of a form variable by   if REQUEST.has_key('first_name'):   or  

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Muk Yan
Hey Jonathan, All, Thanks I tried your solution, but it doesn't seem to work.  Can anybody shed some more light on this situation, since what Jonathan provides is exactly what I want to do, but it's not working. Am I forgetting to put parameteres or some other newbie mistake like that? Thanks in

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Jonathan
, August 17, 2006 4:20 PM Subject: Re: [Zope] Python Scripts and HTML Forms Hey Jonathan, All,Thanks I tried your solution, but it doesn't seem to work.  Can anybody shed some more light on this situation, since what Jonathan provides is exactly what I want to do, but it's

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Muk Yan
; zope@zope.org Sent: Thursday, August 17, 2006 4:20 PM Subject: Re: [Zope] Python Scripts and HTML Forms Hey Jonathan, All,Thanks I tried your solution, but it doesn't seem to work.  Can anybody shed some more light on this situation, since what Jonathan provides is exact

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Jonathan
entered in the form field)     Jonathan     - Original Message - From: Muk Yan To: Jonathan Cc: zope@zope.org Sent: Thursday, August 17, 2006 4:40 PM Subject: Re: [Zope] Python Scripts and HTML Forms Hey All,Sorry about that, what I meant is that I get a KeyErr

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Gabriel Genellina
At Thursday 17/8/2006 17:40, Muk Yan wrote: Sorry about that, what I meant is that I get a KeyError. It says that the first_name in REQUEST['first_name'] is not found, when I try to set the variable in line in the script where fname = REQUEST['first_name']. Read the previous responses, you h

Re: [Zope] Python Scripts and HTML Forms

2006-08-18 Thread Muk Yan
- Original Message - From: Muk Yan To: Jonathan Cc: zope@zope.org Sent: Thursday, August 17, 2006 4:40 PM Subject: Re: [Zope] Python Scripts and HTML Forms Hey All,Sorry about that, what I meant is that I get a KeyError. It says that the first_name in REQUEST[