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

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 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

[Zope] Python scripts

2012-07-06 Thread Richard Harley
Hi 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? Thanks Rich ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** N

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[

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-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 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
, 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
;first_name']     you can check for the presence of a form variable by   if REQUEST.has_key('first_name'):   or   if REQUEST.get('first_name', None):     hth   Jonathan   - Original Message - From: Muk Yan To: zope@zope.org Sent: Thursday, Augus

Re: [Zope] Python Scripts and HTML Forms

2006-08-17 Thread Jonathan
st_name'):   or   if REQUEST.get('first_name', None):     hth   Jonathan   - Original Message - From: Muk Yan To: zope@zope.org Sent: Thursday, August 17, 2006 2:57 PM Subject: [Zope] Python Scripts and HTML Forms Dear Trusted Zope Zealots,This subjec

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 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 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

[Zope] Python Scripts and HTML Forms

2006-08-17 Thread Muk Yan
Dear Trusted Zope Zealots,This subject was a bit too broad to do a google search on, because I've tried and the lack of relevancy was astounding.I've probably been committing a cardinal sin in DTML, but I couldn't figure any other work around. I have an HTML form in a DTML Document say:Name: I want

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

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-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-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

[Zope] Python Scripts

2005-06-16 Thread Dennis Allison
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? -- Dennis Allison * Computer Systems Laboratory * Gates 227 * Sta

[Zope] Python Scripts vs PythonMethods

2001-01-29 Thread David K. Trudgett
On Mon, Jan 29, 2001 at 11:50:17AM -0600, Fred Yankowski wrote: > over those methods manually to Python Scripts. Rats. I'm just glad I > didn't have too much invested into PythonMethods. > Admittedly, I haven't been following this very closely, but wasn't Python Scripts going to simply be a ne

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 in 2.2.x

2001-01-08 Thread Ron Bickers
IL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of > Mayers, Philip J > Sent: Monday, January 08, 2001 10:40 AM > To: '[EMAIL PROTECTED]' > Subject: [Zope] Python Scripts in 2.2.x > > > I need to use LoginManager, which doesn't seem to work with 2.3, >

[Zope] Python Scripts in 2.2.x

2001-01-08 Thread Mayers, Philip J
I need to use LoginManager, which doesn't seem to work with 2.3, and I need to use Python Scripts, which are not available (?) for 2.2.x - any ideas? Regards, Phil +--+ | Phil Mayers, Network Support | | Centre for Computing Services| | Imperial College

[Zope] Python Scripts update

2001-01-04 Thread Evan Simpson
Python Scripts have gone through a fair number of changes and bugfixes recently. They should now work properly as methods of ZClasses. When you download the source of a Python Script, the title, parameter list, and bindings are added to the source in the form of specially formatted comments. If

[Zope] python scripts to import data into ZODB...

2000-12-28 Thread Jonathan B. York
Howdy, I want to import some data into the ZODB and I found this How-To, http://www.zope.org/Members/michel/HowTos/ZODB-How-To, but there are errors in the example code and I haven't been able to get it to work right. Can anyone point to any other information or example code that does something

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