Zope is great. It's so great that I guess I'm trying to use it for doing something different from what zope it's expected to do. I want to make some SQL scripts to access different databases and collect the data in a new table. That I can do with the following external method that calls see_data and put_data ZSQLMethods def get_data(self): result = self.see_data() self.put_data(value=result._data[0][1]) return None Then I wish to make this kind of data management automatic every hour. I dug in the sources and I found out the Scheduler class, which I think is what I need (is it?). But I'm having some trouble using it. This was the external method I tried (without success). def eventGetData(self): rev = RegularEvent(get_data,(),interval=60) self.schedule(rev) return(None) It seems that RegularEvent is not available. Besides, is schedule available trough acquisition in the folder? Can someone give me some light on this. I don't even know if it's possible to use the Scheduler with external methods so it would be great at least to know I'm in the right path. Thanks -- Pedro Vale Lima eq3pvl@eq.uc.pt
Do not try to understand the scheduler. It's not really implemented nor is it useful for anything at this time. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jim Fulton wrote:
Do not try to understand the scheduler. It's not really implemented nor is it useful for anything at this time.
Jim
Pedro - If you need to do periodic tasks, the wisdom of the list says go with a cron job script attaching to your Zopesite via the ZClient interfaces (caveat: I know nothing about this - just repeating what I've read here) Anyone know were to look for info on this elusive ZClient stuff? To quote Paul Everitt <Paul@digicool.com>:
As mentioned later, Zope has a simple RPC mechanism -- it's called HTTP!
ZClient is a package in Zope that automates this. It makes it convenient to connect to Zope and communicate with it from a scripting, non-interactive environment.
Ross -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
On Tue, Mar 23, 1999 at 12:05:48PM -0600, Ross J. Reedstrom wrote:
Jim Fulton wrote:
Do not try to understand the scheduler. It's not really implemented nor is it useful for anything at this time.
If you need to do periodic tasks, the wisdom of the list says go with a cron job script attaching to your Zopesite via the ZClient interfaces (caveat: I know nothing about this - just repeating what I've read here) Anyone know were to look for info on this elusive ZClient stuff?
Read the source luke :-) Actually here's where to find the basics of what you're interested in... .../lib/python/ZPublisher/Client.py This should probably go into the FAQ in the ZDP PDQ ;-) I remember seeing a few examples of it, for the the life of me, I can't find them! Chris -- | Christopher Petrilli ``Television is bubble-gum for | petrilli@amber.org the mind.''-Frank Lloyd Wright
"Ross J. Reedstrom" wrote:
(snip)
If you need to do periodic tasks, the wisdom of the list says go with a cron job script attaching to your Zopesite via the ZClient interfaces (caveat: I know nothing about this - just repeating what I've read here) Anyone know were to look for info on this elusive ZClient stuff? (snip)
The next release of Zope will have a 'utilities' directory in the distribution that has a load_site.py utility that demonstrates use of ZClient (aka ZPublisher.Client). If you want to get this now, you can get it via Zope public CVS access. See http://www.zope.org/Community/Services/CVS_public_access for details. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
"Ross J. Reedstrom" wrote:
Pedro - If you need to do periodic tasks, the wisdom of the list says go with a cron job script attaching to your Zopesite via the ZClient interfaces (caveat: I know nothing about this - just repeating what I've read here) Anyone know were to look for info on this elusive ZClient stuff?
After reading Jim's mail I turned myself to the cron. I had already written a simple script to http-call a DTMLDocument that calls my external method. It works, but now that you told me about ZClient I see I could have saved some time with just a single command ZClient.py [-u username:password] url [name=value ...] Thanks guys pedro --- Pedro Vale Lima eq3pvl@eq.uc.pt
participants (4)
-
Christopher Petrilli -
Jim Fulton -
Pedro Vale Lima -
Ross J. Reedstrom