[Zope] Re:[Zope]Python Method question

entropia entropiamax@jazzfree.com
Tue, 08 Aug 2000 16:05:02 +0200


--------------4212DDA6FC20A9F2EE30701C
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I am a Zope Newbie. I dont understand ZOpe too much. I know python but I am
not an expert. Well, I want to make a Zope Product. There is a python
program Pagecast (pagecast.sourceforge.net, I am not the creator) that I
want to transform in a Product. This program submit a list of URL to
various search engines. For each search engine there is a file that is
executable code. My desire is that this files can be modified by any
manager, not only the system administrator. For security reason I think
that this should be a Python Method.
In the original code I have:

 for file in Servers:
            count = count + 1
            # TODO insert security here
            execfile(file, globals(), locals())

where servers is a list Servers=["google.def","altavista.def",...]
As I said, this .def files are executable code.
My question is:
How can I execute this file if this file is a PythonMethod? Is that
posible?

Chris McDonough escribió:

> I'm still not sure what you mean (I'm sure this is my fault...)
>
> > -----Original Message-----
> > From: entropia [mailto:entropiamax@jazzfree.com]
> > Sent: Tuesday, August 08, 2000 7:34 AM
> > To: zope@zope.org
> > Subject: [Zope] Re:[Zope]Python Method question
> >
> >
> > My question is this:
> >  I have a Zope Product. I want that some modules from this product be
> > configurable. I can use exec() but then I have a big security
> > hole. I am
> > not
> > a ZOBD expert, but I belive thet it doesn't save methods, only
> > variables.
> > Exits somo trick thet permits me:
> > import aPythonMethod
> > or
> > x=PythonMethod.call(....)
> > or something
> > Is that posible?
> >
> > Chris McDonough escribió:
> >
> > > Do you mean you want to use a Python Method (in the sense of a
> > methodish
> > > object instantiated from Evan Simpson's Python Method
> > Product) from a
> > > Python Product?  You *should* be able to call it by getting
> > a hold of
> > it
> > > through acquisition or by otherwise getting a hold of an
> > object in the
> >
> > > ZODB and traversing from it.
> > >
> > > > -----Original Message-----
> > > > From: entropia [mailto:entropiamax@jazzfree.com]
> > > > Sent: Monday, August 07, 2000 3:20 AM
> > > > To: zope@zope.org
> > > > Subject: [Zope] Python Method question
> > > >
> > > >
> > > > I hava a question regards Python Method: How can I
> > > > import a Python Method from a Product module?
> > > >
> > > >
> > > > _______________________________________________
> > > > 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 )
> > > >
> >
> >
> >
> >
> > _______________________________________________
> > 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 )
> >

--------------4212DDA6FC20A9F2EE30701C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I am a Zope Newbie. I dont understand ZOpe too much. I know python but
I am not an expert. Well, I want to make a Zope Product. There is a python
program Pagecast (pagecast.sourceforge.net, I am not the creator) that
I want to transform in a Product. This program submit a list of URL to
various search engines. For each search engine there is a file that is
executable code. My desire is that this files can be modified by any manager,
not only the system administrator. For security reason I think that this
should be a Python Method.
<br>In the original code I have:
<p>&nbsp;<i>for file in Servers:</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
count = count + 1</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# TODO insert security here</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
execfile(file, globals(), locals())</i><i></i>
<p>where servers is a list Servers=["google.def","altavista.def",...]
<br>As I said, this .def files are executable code.
<br>My question is:
<br>How can I execute this file if this file is a PythonMethod? Is that
posible?
<p>Chris McDonough escribi&oacute;:
<blockquote TYPE=CITE>I'm still not sure what you mean (I'm sure this is
my fault...)
<p>> -----Original Message-----
<br>> From: entropia [<a href="mailto:entropiamax@jazzfree.com">mailto:entropiamax@jazzfree.com</a>]
<br>> Sent: Tuesday, August 08, 2000 7:34 AM
<br>> To: zope@zope.org
<br>> Subject: [Zope] Re:[Zope]Python Method question
<br>>
<br>>
<br>> My question is this:
<br>>&nbsp; I have a Zope Product. I want that some modules from this product
be
<br>> configurable. I can use exec() but then I have a big security
<br>> hole. I am
<br>> not
<br>> a ZOBD expert, but I belive thet it doesn't save methods, only
<br>> variables.
<br>> Exits somo trick thet permits me:
<br>> import aPythonMethod
<br>> or
<br>> x=PythonMethod.call(....)
<br>> or something
<br>> Is that posible?
<br>>
<br>> Chris McDonough escribi&oacute;:
<br>>
<br>> > Do you mean you want to use a Python Method (in the sense of a
<br>> methodish
<br>> > object instantiated from Evan Simpson's Python Method
<br>> Product) from a
<br>> > Python Product?&nbsp; You *should* be able to call it by getting
<br>> a hold of
<br>> it
<br>> > through acquisition or by otherwise getting a hold of an
<br>> object in the
<br>>
<br>> > ZODB and traversing from it.
<br>> >
<br>> > > -----Original Message-----
<br>> > > From: entropia [<a href="mailto:entropiamax@jazzfree.com">mailto:entropiamax@jazzfree.com</a>]
<br>> > > Sent: Monday, August 07, 2000 3:20 AM
<br>> > > To: zope@zope.org
<br>> > > Subject: [Zope] Python Method question
<br>> > >
<br>> > >
<br>> > > I hava a question regards Python Method: How can I
<br>> > > import a Python Method from a Product module?
<br>> > >
<br>> > >
<br>> > > _______________________________________________
<br>> > > Zope maillist&nbsp; -&nbsp; Zope@zope.org
<br>> > > <a href="http://lists.zope.org/mailman/listinfo/zope">http://lists.zope.org/mailman/listinfo/zope</a>
<br>> > > **&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp; **
<br>> > > (Related lists -
<br>> > >&nbsp; <a href="http://lists.zope.org/mailman/listinfo/zope-announce">http://lists.zope.org/mailman/listinfo/zope-announce</a>
<br>> > >&nbsp; <a href="http://lists.zope.org/mailman/listinfo/zope-dev">http://lists.zope.org/mailman/listinfo/zope-dev</a>
)
<br>> > >
<br>>
<br>>
<br>>
<br>>
<br>> _______________________________________________
<br>> Zope maillist&nbsp; -&nbsp; Zope@zope.org
<br>> <a href="http://lists.zope.org/mailman/listinfo/zope">http://lists.zope.org/mailman/listinfo/zope</a>
<br>> **&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp; **
<br>> (Related lists -
<br>>&nbsp; <a href="http://lists.zope.org/mailman/listinfo/zope-announce">http://lists.zope.org/mailman/listinfo/zope-announce</a>
<br>>&nbsp; <a href="http://lists.zope.org/mailman/listinfo/zope-dev">http://lists.zope.org/mailman/listinfo/zope-dev</a>
)
<br>></blockquote>
</html>

--------------4212DDA6FC20A9F2EE30701C--