Re: [Zope] external method and forms

2013-01-07 Thread murat bilal
At last I find and change everything.Now it looks like this: --MY DTML DOCUMENT- form action= method=postbr / pbr KULLANICI ADI br input type=text name=name pbr SIFREbr input type=text name=sifre pbr SIFRE YENIDENbr input type=text name=sifret input type=submit name=formParams:action

Re: [Zope] external method

2009-06-16 Thread Chris Withers
Garry Saddington wrote: I have the following external method to back up a postgres database, using the following software versions. Why on earth would you not just do this in a cron job?! Chris -- Simplistix - Content Management, Zope Python Consulting -

Re: [Zope] external method

2009-06-16 Thread Garry Saddington
Chris Withers wrote: Garry Saddington wrote: I have the following external method to back up a postgres database, using the following software versions. Why on earth would you not just do this in a cron job?! Chris Because I want the backup to be done manually, through the

Re: [Zope] external method

2009-06-16 Thread Chris Withers
Garry Saddington wrote: Because I want the backup to be done manually, That doesn't seem like such a hot idea. Something that's easilly forgotten. Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk

Re: [Zope] external method

2009-06-16 Thread Garry Saddington
Garry Saddington wrote: Chris Withers wrote: Garry Saddington wrote: Because I want the backup to be done manually, That doesn't seem like such a hot idea. Something that's easilly forgotten. Thanks, I've sorted it. Turns out that pg_dump was being run by SYSTEM and

Re: [Zope] external method

2009-06-15 Thread Miguel Beltran R.
Zope is running as user scholarpack who is an administrator on win server 2008. / usar scholarpack have rights to access postgres? are you see the logs from postgres? new conecctions? or logs from zope? ___ Zope maillist - Zope@zope.org

Re: [Zope] External Method in Zope

2008-04-07 Thread Andreas Jung
--On 7. April 2008 13:15:04 +0530 vaibhav pol [EMAIL PROTECTED] wrote: hi, I am using Zope-2.8.1-final and also added zoperl-1.0.beta5 for perl support . I wrote a Perl module which edit files the file access permission is only to root and i want to invoking the module as onther user . by

Re: [Zope] External Method in Zope

2008-04-07 Thread Jens Vagelpohl
On Apr 7, 2008, at 11:23 , vaibhav pol wrote: Thanks alot but i am not using command but i using perl function to modify the passwd and shadow file. in my module that's why i want to invoke that module as root There's a few things seriously wrong with your plan: - you want to create a

Re: [Zope] External Method in Zope

2008-04-07 Thread vaibhav pol
Thanks alot but i am not using command but i using perl function to modify the passwd and shadow file. in my module that's why i want to invoke that module as root On Mon, Apr 7, 2008 at 1:19 PM, Andreas Jung [EMAIL PROTECTED] wrote: --On 7. April 2008 13:15:04 +0530 vaibhav pol [EMAIL

Re: [Zope] External Method in Zope

2008-04-07 Thread Chris Withers
Jens Vagelpohl wrote: - doing Perl methods or external methods in Zope has been deprecated years and years ago. You will have a hard time finding anyone to support that. I'm guessing you mean perl external methods rather than all external methods in general? ;-) Chris -- Simplistix -

Re: [Zope] External Method in Zope

2008-04-07 Thread Jens Vagelpohl
On Apr 7, 2008, at 12:18 , Chris Withers wrote: Jens Vagelpohl wrote: - doing Perl methods or external methods in Zope has been deprecated years and years ago. You will have a hard time finding anyone to support that. I'm guessing you mean perl external methods rather than all external

Re: [Zope] External Method in Zope

2008-04-07 Thread Thomas Bennett
If you absolutely have to, look at Paramiko a python ssh/sftp library which is easy to use but as mentioned already there are critical security issues. with paramiko you don't have to directly edit the files but within an ssh connection run the commands needed that actually make the changes.

Re: [Zope] External Method unable to run Java jar executable using os.system()

2007-02-13 Thread Andreas Jung
--On 12. Februar 2007 07:34:09 -0800 Ridzwan Aminuddin [EMAIL PROTECTED] wrote: java -jar /var/lib/zope2.8/instance/plone-site/Extensions/test.jar it works perfectly But using the external method given above just gives me a blank output. I've also tried popen2: from

Re: [Zope] External Method importing modules

2007-02-13 Thread Andreas Jung
--On 13. Februar 2007 12:53:25 + Alan [EMAIL PROTECTED] wrote: Dear List, I have an external method and now I developed I new module in a separated file and then I am trying to make my external method to import it but I am failing here. Where should place my module file in order to be

Re: [Zope] External Method importing modules

2007-02-13 Thread Alan
Thanks Andreas, I am trying with: if sys.path.count(myPath) == 0: sys.path.insert(0, myPath) where myPath should be '[Zope installation folder]/instance/import'. So my question now is: is there a variable inside Zope which can returns the 'import' path? Many thanks in advance. Cheers, Alan

Re: [Zope] External Method importing modules

2007-02-13 Thread Andreas Jung
--On 13. Februar 2007 13:10:17 + Alan [EMAIL PROTECTED] wrote: Thanks Andreas, I am trying with: if sys.path.count(myPath) == 0: sys.path.insert(0, myPath) What's the sense of this code? sys.path is usually *never* empty. You should really look at the Python docs and learn where Python

Re: [Zope] External Method importing modules

2007-02-13 Thread Jonathan
- Original Message - From: Alan [EMAIL PROTECTED] To: Andreas Jung [EMAIL PROTECTED] Cc: zope@zope.org Sent: Tuesday, February 13, 2007 8:10 AM Subject: Re: [Zope] External Method importing modules Thanks Andreas, I am trying with: if sys.path.count(myPath) == 0: sys.path.insert(0

Re: [Zope] External Method importing modules

2007-02-13 Thread Alan
Well, I did it: from App.config import getConfiguration extPath = getConfiguration().instancehome+'/Extensions' if sys.path.count(extPath) == 0: sys.path.insert(0, extPath) And it worked for what I wanted. On 13/02/07, Alan [EMAIL PROTECTED] wrote: On 13/02/07, Andreas Jung [EMAIL PROTECTED]

Re: [Zope] External Method importing modules

2007-02-13 Thread Dieter Maurer
Alan wrote at 2007-2-13 13:10 +: if sys.path.count(myPath) == 0: sys.path.insert(0, myPath) where myPath should be '[Zope installation folder]/instance/import'. So my question now is: is there a variable inside Zope which can returns the 'import' path? Formerly, the ExternalMethod

Re: [Zope] External Method cPickle Import Module Error

2006-12-31 Thread Dieter Maurer
Sean W. Duffy wrote at 2006-12-27 19:44 -0600: ... I have upgraded from Zope 2.8.5 to 2.9.4. This currently works in the 2.8.5 instance but not in the 2.9.4. I have a Module Progress in /usr/lib/python2.4/site-packages/Progress containing 4 files: __init__.py __init__.pyc Progress.py

Re: [Zope] External Method cPickle Import Module Error

2006-12-27 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 27. Dezember 2006 19:44:24 -0600 Sean W. Duffy [EMAIL PROTECTED] wrote: Hi, I have upgraded from Zope 2.8.5 to 2.9.4. This currently works in the 2.8.5 instance but not in the 2.9.4. I have a Module Progress in

Re: [Zope] external method, not escaping and

2006-12-21 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 21. Dezember 2006 20:32:39 +0100 Mihamina Rakotomandimby [EMAIL PROTECTED] wrote: Hi, I have an external method that fetches some web content (POP messages) then format an HTML output to make it easy to display. the Id of the external

Re: [Zope] External Method = Slow; Shell Script = Fast

2006-11-02 Thread Maciej Wisniowski
ZopeProfiler seems to come with no instructions to install. Can you advise? I haven't installed it for years, but i seem to remember that it installed just like a normal product (ie. install in the Products directory, restart zope, it shows up automagically - in linux that is, i don't do

Re: [Zope] External Method = Slow; Shell Script = Fast

2006-11-02 Thread Edward Pollard
On 11/2/06 6:52 AM, Maciej Wisniowski [EMAIL PROTECTED] wrote: To install ZopeProfiler product you have to copy it to Products/ folder of your zope instance, restart your Zope and go to ControlPanel in ZMI. You should see new link there: Zope Profiler. When you want to start profiling you hit

Re: [Zope] External Method = Slow; Shell Script = Fast

2006-11-02 Thread Andrew Milton
+---[ Edward Pollard ]-- | | I was aware the built-in profiling existed but I've never found it very easy | to work with. However, when I installed ZopeProfiler it complained the | built-in profiling was enabled, which was news to me. | | I turned it off and my problem

Re: [Zope] External Method = Slow; Shell Script = Fast

2006-11-02 Thread Andreas Jung
--On 2. November 2006 09:08:13 -0600 Edward Pollard [EMAIL PROTECTED] wrote: On 11/2/06 6:52 AM, Maciej Wisniowski [EMAIL PROTECTED] wrote: To install ZopeProfiler product you have to copy it to Products/ folder of your zope instance, restart your Zope and go to ControlPanel in ZMI. You

Re: [Zope] External Method = Slow; Shell Script = Fast

2006-11-01 Thread Jonathan
- Original Message - From: Edward Pollard [EMAIL PROTECTED] To: zope@zope.org Sent: Wednesday, November 01, 2006 5:58 PM Subject: [Zope] External Method = Slow; Shell Script = Fast Hello, I've got an external method that does some pretty complicated stuff. Basically it takes two

Re: [Zope] External Method = Slow; Shell Script = Fast

2006-11-01 Thread Jonathan
- Original Message - From: Edward Pollard [EMAIL PROTECTED] To: Jonathan [EMAIL PROTECTED] Sent: Wednesday, November 01, 2006 5:21 PM Subject: Re: [Zope] External Method = Slow; Shell Script = Fast Hi Jon, ZopeProfiler seems to come with no instructions to install. Can you advise

Re: [Zope] external method strangeness

2006-10-19 Thread garry saddington
On Wed, 2006-10-18 at 15:07 -0400, Paul Winkler wrote: On Wed, Oct 18, 2006 at 06:13:38PM +0100, garry saddington wrote: Can anyone explain what is happening here. I am using Saxon to transform an xml file(source) using a stylesheet(style) the result is then written to Postgres. The

Re: [Zope] external method strangeness

2006-10-19 Thread Dieter Maurer
garry saddington wrote at 2006-10-18 18:13 +0100: ... import psycopg, string, re, subprocess def scholarpack_xml_transform(source): f=open('/opt/scholarpack/ancillary/source.xml','w') f.write(source) f.close The line above looks buggy: missing (). ...

Re: [Zope] external method strangeness

2006-10-18 Thread Andrew Milton
+---[ garry saddington ]-- | Can anyone explain what is happening here. I am using Saxon to transform | an xml file(source) using a stylesheet(style) the result is then written | to Postgres. The contents of source are uploaded in Zope and passed to | the external method as

Re: [Zope] external method strangeness

2006-10-18 Thread Andrew Milton
+---[ garry saddington ]-- | On Thu, 2006-10-19 at 03:18 +1000, Andrew Milton wrote: | +---[ garry saddington ]-- | | Can anyone explain what is happening here. I am using Saxon to transform | | an xml file(source) using a stylesheet(style) the

Re: [Zope] external method strangeness

2006-10-18 Thread Paul Winkler
On Wed, Oct 18, 2006 at 06:13:38PM +0100, garry saddington wrote: Can anyone explain what is happening here. I am using Saxon to transform an xml file(source) using a stylesheet(style) the result is then written to Postgres. The contents of source are uploaded in Zope and passed to the

Re: [Zope] external method: importing and updating method

2006-10-05 Thread Chris Withers
Alan wrote: Thanks for help. I did what suggested below. We also set a crontab to restart the zope server every night, Why?! Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope

Re: Re: [Zope] external method: importing and updating method

2006-10-05 Thread Alan
Hi List, crontab is really a bad idea. We quitted that. Thanks for your commentaries. Alan On 05/10/06, Chris Withers [EMAIL PROTECTED] wrote: Alan wrote: Thanks for help. I did what suggested below. We also set a crontab to restart the zope server every night, Why?! Chris -- Simplistix

Re: Re: [Zope] external method: importing and updating method

2006-10-05 Thread Andreas Jung
--On 5. Oktober 2006 10:24:31 +0100 Alan [EMAIL PROTECTED] wrote: Hi List, crontab is really a bad idea. We quitted that. Why is using crontab a bad idea? It's the most common and most reliable solution to run scripts in Zope periodically. -aj pgpHnQfkHcCKi.pgp Description: PGP

Re: [Zope] external method: importing and updating method

2006-10-05 Thread Pascal Peregrina
List zope@zope.org Objet : Re: [Zope] external method: importing and updating method -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5 Oct 2006, at 05:24, Alan wrote: Hi List, crontab is really a bad idea. We quitted that. Might make sense to back up blanket nonsensical

Re: Re: [Zope] external method: importing and updating method

2006-10-04 Thread Alan
] To: Alan [EMAIL PROTECTED] Cc: zope@zope.org Sent: Tuesday, October 03, 2006 2:06 PM Subject: Re: [Zope] external method: importing and updating method Alan wrote at 2006-10-2 18:48 +0100: In my external method I have something like this: ... sys.path.insert(0, CCPNPYTHON) This is not a good

Re: Re: [Zope] external method: importing and updating method

2006-10-04 Thread Jonathan
- Original Message - From: Alan [EMAIL PROTECTED] To: Jonathan [EMAIL PROTECTED] Cc: Dieter Maurer [EMAIL PROTECTED]; zope@zope.org Sent: Wednesday, October 04, 2006 6:12 AM Subject: Re: Re: [Zope] external method: importing and updating method Hi Folks, Thanks for help. I did what

Re: Re: [Zope] external method: importing and updating method

2006-10-04 Thread Lennart Regebro
On 10/4/06, Alan [EMAIL PROTECTED] wrote: Thanks for help. I did what suggested below. We also set a crontab to restart the zope server every night, but them I was wondering if it is a good idea. Isn't it better to just restart the server when you have updated the software? Modules loaded from

Re: [Zope] external method: importing and updating method

2006-10-03 Thread Dieter Maurer
Alan wrote at 2006-10-2 18:48 +0100: In my external method I have something like this: ... sys.path.insert(0, CCPNPYTHON) This is not a good idea! The source of an External Method can be read arbitrarily often -- and each time, you extend sys.path... The imp module allows you to import modules

Re: [Zope] external method: importing and updating method

2006-10-03 Thread Jonathan
- Original Message - From: Dieter Maurer [EMAIL PROTECTED] To: Alan [EMAIL PROTECTED] Cc: zope@zope.org Sent: Tuesday, October 03, 2006 2:06 PM Subject: Re: [Zope] external method: importing and updating method Alan wrote at 2006-10-2 18:48 +0100: In my external method I have

Re: [Zope] external method: importing and updating method

2006-10-02 Thread Jonathan
- Original Message - From: Alan [EMAIL PROTECTED] To: zope@zope.org Sent: Monday, October 02, 2006 1:48 PM Subject: [Zope] external method: importing and updating method Hi List! In my external method I have something like this: ... sys.path.insert(0, CCPNPYTHON) from

Re: [Zope] external method with import tarfile

2006-07-19 Thread Alan
Hi there! I managed to find the problem and the solution. First, I've forgot to mention that in my script, oname is an uploaded file. I just inserted a f.close() and voilá! def upload_external(self,file,REQUEST): import os,tarfile ... f=open(oname,wb) f.write(file.read()) f.close() ...

Re: [Zope] external method with import tarfile

2006-07-19 Thread Tino Wildenhain
Alan wrote: Hi there! I managed to find the problem and the solution. First, I've forgot to mention that in my script, oname is an uploaded file. I just inserted a f.close() and voilá! def upload_external(self,file,REQUEST): import os,tarfile ... f=open(oname,wb)

Re: [Zope] external method with import tarfile

2006-07-18 Thread Andreas Jung
--On 18. Juli 2006 16:12:18 +0100 Alan [EMAIL PROTECTED] wrote: Error Type: IOError Error Value: CRC check failed This is unlikely a Zope issue. Either your tar file is broken or the tarfile module is broken. Check if your code runs without Zope as a simple PythonScript..there is nothing

Re: [Zope] External Method Working Directory?

2005-09-30 Thread Chris Withers
jwithers wrote: Because I need to feed the file to Mailman for evil purposes of my own (well, fairly mundane purposes of allowing my zope app to manipulate mailman list memberships, really) that the prototype mailman adapter I found doesn't meet. When I've needed to do simple stuff with this

Re: [Zope] External Method Working Directory?

2005-09-30 Thread jwithers
When I've needed to do simple stuff with this is the past, I just manipulate mailmain by send email from Zope to mailman's admin interface... Pipes seem easier to me. Responses from the command line scripts seem much easier to use for confirmation. And there are things you can do easily

Re: [Zope] External Method Working Directory?

2005-09-29 Thread Chris Withers
jwithers wrote: eep, another one, hope we're not related ;-) Can anyone tell me what the default working directory for an external method is? You can't rely on it being anything. If you're working with files, you need to be very careful... Further, I need this to create a file temporarily

Re: [Zope] External Method Working Directory?

2005-09-29 Thread Dieter Maurer
jwithers wrote at 2005-9-28 15:43 -0700: ... I have an external method that at this point is made up of nothing but os.getcwd() and lives in my Extensions directory. When it is run, it reports the working directory as being one of my Products directories. Some products are broken (they change

Re: [Zope] External Method Working Directory?

2005-09-29 Thread jwithers
On Thu, 2005-09-29 at 00:20, Chris Withers wrote: eep, another one, hope we're not related ;-) When I saw your posts on newsgroups years ago, I almost gave up python programming altogether Chris, thinking that any given field of endeavor needs only one Withers, but decided to go ahead and

Re: [Zope] External Method Working Directory?

2005-09-28 Thread Peter Bengtsson
Products?? That is odd. I thought it was the var/ directory or at least the zope instance home directory. From the External method you should have access to INSTANCE_HOME and SOFTWARE_HOME. Try if these are what you want. I doubt that you'll find your Extensions/ dir in any of them so you might

Re: [Zope] External Method Working Directory?

2005-09-28 Thread David Hassalevris
jwithers, a) Is your os.getcwd() (in /Extensions) called from a Product (in /Products?) Otherwise I have not idea b) Regarding temporary files .. I've used stuff like ... import tempfile tmpFile2 = tempfile.mktemp() theFile=open( tmpFile2,'rb') result = theFile.read()

Re: [Zope] external method and security

2001-01-29 Thread Shane Hathaway
Marty Stitt wrote: Is it up to me to write my own security code when using an external method? Basically, yes. You can protect access to the "stub" within the ZODB using the Security tab, but the body of the external method has free reign. Shane

Re: [Zope] External Method

2000-11-21 Thread Andy McKay
If you are talking about dtml you can pass them in the dtml-call tag dtml-call "my_external_method(_.None, _, param_1=1, param_2=2)" -- Andy McKay, Developer. ActiveState. - Original Message - From: "Kini Natekar" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 21,

Re: [Zope] External Method

2000-11-21 Thread Dieter Maurer
Kini Natekar writes: How can I pass parameters to an External Method? I know of one way to do this, is to use dtml-var tag. Is there any other way? Anywhere, you can use 'expr=""'. This means almost all DTML tags: call, var, in, with, let (without 'expr='!) ... Example:

Re: [Zope] external method import error (ImportError)...

2000-10-07 Thread Dieter Maurer
Eric writes: To summarize: How do I import modules in an External Method's .py file? I remember, I read this in some "External Method" related documentation. You do *NOT* place such modules inside the folder "Extensions" but put them somewhere else reachable by "PYTHONPATH". The documentation

Re: [Zope] external method database connection

2000-10-06 Thread knight
Also, you could always import the specific module for your database, and create a db connection, then execute() and fetch() directly. Although, if you are putting this in an external method, it would be wiser to use your existing ZSQL methods ;] Knight [EMAIL PROTECTED] On Fri, 6 Oct 2000,

Re: [Zope] External method and stdout

2000-09-05 Thread Kapil Thangavelu
Andreas Pauley wrote: For some reason you have to "return" everything that should be available to zope. You can return a sequence and loop through it with DTML or you can build a variable with everything you want to display and then return the variable. I have no idea why this is so, and

Re: [Zope] External Method not accepting CGI module

2000-07-11 Thread Dieter Maurer
Kelvin Cheong writes: import cgi form = cgi.FieldStorage() This gives you an empty "FieldStorage" fileitem = form["userTABPIX1"] In it, "userTABPIX1" is unknown. fname = tempfile.mktemp() fp=open(fname,'w') fp.write(fileitem.file.read()) fp.close() Give

Re: [Zope] External Method Difficulties

2000-06-22 Thread Dieter Maurer
Jason Lee writes: ... external method access ... dtml-call genhash This says, "call the method (for its side effects) but discard any return value". This produces nothing. I think I read somewhere that dtml-call returns no data, so that might explain it. I could be wrong. You are

Re: [Zope] External Method Difficulties

2000-06-22 Thread Jason Lee
Dieter Maurer wrote: dtml-var genhash That should work. What KeyError do you get? The error message's head should tell you what key has not been found. The traceback at the foot (especially the last line) tells you where the KeyError occured. After I posted, I did some more wild,