Hi Zopistas: I am wondering how I could write a python script that interacts with Zope from within another script (on a Linux box). I have a Perl script that ftp Zope through port 8021. No problem there; however, when I upload the new objects I would like to add properties at the same time that they are being uploaded (this will avoid my having to go TTW and do that manually afterwards, which is time consuming and not very efficient). To do that I think a python script could be run that adds new properties to Zope while I am adding each object (I think something simple like a function that takes 2 args would do, ie, the property name, and value); I would also want to add dtml methods programmatically if needed, but I am not so sure how to do that. I have no problems running programs from within Perl, but what I wonder is how I could write a python script that interacts with Zope from my console. Is that possible? Or is it a security issue? Any ideas will be appreciated. TIA, Regards, Jorge M. -- Jorge O. Martinez MIS Senior Associate FDCH-eMedia Inc. 2400 Forbes Blvd., Suite 200 Lanham, MD 20706 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)731-1228 ext. 105 Fax => (301)731-0937
Search for the monitor port for Zope. It gives you a python shell into Zope. -- Andy McKay @gmweb Consulting http://www.agmweb.ca ----- Original Message ----- From: "Jorge O. Martinez" <jmartinez@eMediaMillWorks.com> To: <zope@zope.org> Sent: Monday, August 05, 2002 10:26 AM Subject: [Zope] Zope scripting from the console
Hi Zopistas:
I am wondering how I could write a python script that interacts with Zope from within another script (on a Linux box). I have a Perl script that ftp Zope through port 8021. No problem there; however, when I upload the new objects I would like to add properties at the same time that they are being uploaded (this will avoid my having to go TTW and do that manually afterwards, which is time consuming and not very efficient).
To do that I think a python script could be run that adds new properties to Zope while I am adding each object (I think something simple like a function that takes 2 args would do, ie, the property name, and value); I would also want to add dtml methods programmatically if needed, but I am not so sure how to do that.
I have no problems running programs from within Perl, but what I wonder is how I could write a python script that interacts with Zope from my console. Is that possible? Or is it a security issue? Any ideas will be appreciated.
TIA,
Regards,
Jorge M.
-- Jorge O. Martinez MIS Senior Associate FDCH-eMedia Inc. 2400 Forbes Blvd., Suite 200 Lanham, MD 20706 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)731-1228 ext. 105 Fax => (301)731-0937
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Thanks, I'll try that. Jorge M. Andy McKay wrote:
Search for the monitor port for Zope. It gives you a python shell into Zope. -- Andy McKay @gmweb Consulting http://www.agmweb.ca
----- Original Message ----- From: "Jorge O. Martinez" <jmartinez@eMediaMillWorks.com> To: <zope@zope.org> Sent: Monday, August 05, 2002 10:26 AM Subject: [Zope] Zope scripting from the console
Hi Zopistas:
I am wondering how I could write a python script that interacts with Zope
from
within another script (on a Linux box). I have a Perl script that ftp Zope through port 8021. No problem there; however, when I upload the new
objects I
would like to add properties at the same time that they are being uploaded (this will avoid my having to go TTW and do that manually afterwards,
which is
time consuming and not very efficient).
To do that I think a python script could be run that adds new properties
to
Zope while I am adding each object (I think something simple like a
function
that takes 2 args would do, ie, the property name, and value); I would
also
want to add dtml methods programmatically if needed, but I am not so sure
how
to do that.
I have no problems running programs from within Perl, but what I wonder is
how
I could write a python script that interacts with Zope from my console. Is
that
possible? Or is it a security issue? Any ideas will be appreciated.
TIA,
Regards,
Jorge M.
-- Jorge O. Martinez MIS Senior Associate FDCH-eMedia Inc. 2400 Forbes Blvd., Suite 200 Lanham, MD 20706 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)731-1228 ext. 105 Fax => (301)731-0937
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Jorge O. Martinez MIS Senior Associate FDCH-eMedia Inc. 2400 Forbes Blvd., Suite 200 Lanham, MD 20706 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)731-1228 ext. 105 Fax => (301)731-0937
Have a look to /where/you/installed/zope/doc/ZODB.txt It shows how to script Zope from the console. But you *must* stop the zope server before doing this (seems that ZODB cannot be used concurrently from 2 different processes). But perhaps ZEO (didn't test) can help. Cheers --Gilles ----- Original Message ----- From: "Jorge O. Martinez" <jmartinez@eMediaMillWorks.com> To: <zope@zope.org> Sent: Monday, August 05, 2002 7:26 PM Subject: [Zope] Zope scripting from the console
Hi Zopistas:
[...]
Thanks for the info. That's a bummer though 'cause I cannot stop ZODB while I upload new content to the site, but I'll look into it, and hopefully can come up with something. Wish Zope was as user friendly TTC (through the console) as it is TTW, so I could automate these kind of tasks... Regards, Jorge M. Gilles Lenfant wrote:
Have a look to /where/you/installed/zope/doc/ZODB.txt
It shows how to script Zope from the console. But you *must* stop the zope server before doing this (seems that ZODB cannot be used concurrently from 2 different processes). But perhaps ZEO (didn't test) can help.
Cheers
--Gilles
----- Original Message ----- From: "Jorge O. Martinez" <jmartinez@eMediaMillWorks.com> To: <zope@zope.org> Sent: Monday, August 05, 2002 7:26 PM Subject: [Zope] Zope scripting from the console
Hi Zopistas:
[...]
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Jorge O. Martinez MIS Senior Associate FDCH-eMedia Inc. 2400 Forbes Blvd., Suite 200 Lanham, MD 20706 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)731-1228 ext. 105 Fax => (301)731-0937
Jorge O. Martinez wrote:
Thanks for the info. That's a bummer though 'cause I cannot stop ZODB while I upload new content to the site, but I'll look into it,
ZEO is your friend ;-) I use ZEo for precicely this kind of thing... cheers, Chris
On Mon, 05 Aug 2002 13:26:47 -0400 "Jorge O. Martinez" <jmartinez@eMediaMillWorks.com> wrote:
is how I could write a python script that interacts with Zope from my console. Is that possible? Or is it a security issue? Any ideas will be appreciated.
Some ideas there : - xml-rpc - wget special urls (for example a python script), something like : http://www.site.com/mypath/myobject/addproperty?id=author&type=string&conten... (you'll have to write the script yourself, but it is easy. You should use wget authentification). Looks like "poor man xml-rpc" - I think you can also connect directly to zodb, but I don't think it's needed. (ZEO) hth -- Philippe Jadin 123piano.com
Thanks, I'll look into this. I was also thinking I might use the file system product in Zope, or just put the images and other stuff I need in Mysql as a blob, probably that will work out better. Again thanks for the ideas, Jorge M. Philippe Jadin wrote:
On Mon, 05 Aug 2002 13:26:47 -0400 "Jorge O. Martinez" <jmartinez@eMediaMillWorks.com> wrote:
is how I could write a python script that interacts with Zope from my console. Is that possible? Or is it a security issue? Any ideas will be appreciated.
Some ideas there :
- xml-rpc - wget special urls (for example a python script), something like : http://www.site.com/mypath/myobject/addproperty?id=author&type=string&conten...
(you'll have to write the script yourself, but it is easy. You should use wget authentification). Looks like "poor man xml-rpc"
- I think you can also connect directly to zodb, but I don't think it's needed. (ZEO)
hth
-- Jorge O. Martinez MIS Senior Associate FDCH-eMedia Inc. 2400 Forbes Blvd., Suite 200 Lanham, MD 20706 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)731-1228 ext. 105 Fax => (301)731-0937
participants (5)
-
Andy McKay -
Chris Withers -
Gilles Lenfant -
Jorge O. Martinez -
Philippe Jadin