Date utility for Zope (V2)
I am looking for a standard way (from a python script in Zope) to define and manipulate time intervals for periodic events. I need to define things like every weekday at 8 am, the 2nd day of every month at 8am, every weekday at 8am, 10am and 3pm in addition to easy things like everyday at 1pm. Does such a standard exist - perhaps with a library to manage the conversion to real times? On another forum this http://labix.org/python-dateutil was suggested -- it looks to be close to what I was thinking -- but I am not totally sure how I can use it in Zope (a level of incompetence issue no doubt). Is there something else Zope(not Plone) ready? Or alternately how would I use this in Zope?
On Tue, Nov 9, 2010 at 22:12, Brian Sullivan <briansullivan@gmail.com> wrote:
On another forum this http://labix.org/python-dateutil was suggested -- it looks to be close to what I was thinking --
I second that.
but I am not totally sure how I can use it in Zope (a level of incompetence issue no doubt).
You would use it as you would use it outside Zope. No difference, it's just all Python. //Lennart
I guess I having a mental block then. To use it from what I know I would have create a Zope 2 product from it somehow or create callable scripts in the ZMI from the provided code. Neither seems reasonable. Is there other way to use the code that I am not understanding? On Tue, Nov 9, 2010 at 6:11 PM, Lennart Regebro <regebro@gmail.com> wrote:
On Tue, Nov 9, 2010 at 22:12, Brian Sullivan <briansullivan@gmail.com> wrote:
On another forum this http://labix.org/python-dateutil was suggested -- it looks to be close to what I was thinking --
I second that.
but I am not totally sure how I can use it in Zope (a level of incompetence issue no doubt).
You would use it as you would use it outside Zope. No difference, it's just all Python.
//Lennart
Am 10.11.2010 02:00, schrieb Brian Sullivan:
I guess I having a mental block then. To use it from what I know I would have create a Zope 2 product from it somehow or create callable scripts in the ZMI from the provided code. Neither seems reasonable.
Is there other way to use the code that I am not understanding? it is enough to create an external python script. this is a "normal" python script that has to reside in YOUR ZOPEINSTANCE/parts/instance/Extentions
you can do what ever you like in such a script. there are no restrictions (that I know of). robert
On Tue, Nov 9, 2010 at 6:11 PM, Lennart Regebro<regebro@gmail.com> wrote:
On Tue, Nov 9, 2010 at 22:12, Brian Sullivan<briansullivan@gmail.com> wrote:
On another forum this http://labix.org/python-dateutil was suggested -- it looks to be close to what I was thinking -- I second that.
but I am not totally sure how I can use it in Zope (a level of incompetence issue no doubt). You would use it as you would use it outside Zope. No difference, it's just all Python.
//Lennart
_______________________________________________ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
On Wed, Nov 10, 2010 at 02:00, Brian Sullivan <briansullivan@gmail.com> wrote:
I guess I having a mental block then. To use it from what I know I would have create a Zope 2 product from it somehow or create callable scripts in the ZMI from the provided code. Neither seems reasonable.
Is there other way to use the code that I am not understanding?
Well, you need to do something with the rrules, yes. And that obviously needs to be done in some sort of Zope product. And you will need to write that, so it does what you want it to do. But the dtutil module itself you simply use from Python like this: from dtutil import rrule rrule.whatevereblahlahlah() I have the feeling (but I could be wrong) that there is a very long distance from what you want to what you say you want. Maybe you can explain what you actually want to do, your usecases etc. -- Lennart Regebro, Colliberty: http://www.colliberty.com/ Telephone: +48 691 268 328
I have recurring events that I want to schedule (the events are sending email, Twitter DMs and Facebook messages -- at least those are the possible ones that I have identified so far). I need some flexible way to both specify the intervals and interpret the intervals so that the next event in a sequence can be specified in real time terms and scheduled. The event schedule at least in plain English could be something like " every weekday at 8:45", "every Monday at 9:00 and 1:00", "every day at 2:00", "the first of every month at 9:00", "every other Monday". I realize that I may have to settle for something that is not quite as flexible as I imagine and at least for now I am just trying to see if someone else has solved this problem or one similar and has something I can use as a base. I do have a way to trigger and execute the events at specific times. On Wed, Nov 10, 2010 at 5:00 AM, Lennart Regebro <regebro@gmail.com> wrote:
On Wed, Nov 10, 2010 at 02:00, Brian Sullivan <briansullivan@gmail.com> wrote:
I guess I having a mental block then. To use it from what I know I would have create a Zope 2 product from it somehow or create callable scripts in the ZMI from the provided code. Neither seems reasonable.
Is there other way to use the code that I am not understanding?
Well, you need to do something with the rrules, yes. And that obviously needs to be done in some sort of Zope product. And you will need to write that, so it does what you want it to do.
But the dtutil module itself you simply use from Python like this:
from dtutil import rrule rrule.whatevereblahlahlah()
I have the feeling (but I could be wrong) that there is a very long distance from what you want to what you say you want. Maybe you can explain what you actually want to do, your usecases etc.
-- Lennart Regebro, Colliberty: http://www.colliberty.com/ Telephone: +48 691 268 328
On Wed, Nov 10, 2010 at 15:25, Brian Sullivan <briansullivan@gmail.com> wrote:
I have recurring events that I want to schedule (the events are sending email, Twitter DMs and Facebook messages -- at least those are the possible ones that I have identified so far).
Right, so you need to make these events as you normally write your applications.
I need some flexible way to both specify the intervals and interpret the intervals so that the next event in a sequence can be specified in real time terms and scheduled.
And that's what dateutil.rrule is for. -- Lennart Regebro, Colliberty: http://www.colliberty.com/ Telephone: +48 691 268 328
I had a look at tutorials to create products for Zope2 and at first glance they are beyond by pay grade. Maybe I will look at them more closely to see if I might have been hasty but likely it will be easier for me and take less time just to write what I need in script and forgo the "I would like to do stuff". Regardless thanks for the help. On Wed, Nov 10, 2010 at 5:30 PM, Lennart Regebro <regebro@gmail.com> wrote:
On Wed, Nov 10, 2010 at 15:25, Brian Sullivan <briansullivan@gmail.com> wrote:
I have recurring events that I want to schedule (the events are sending email, Twitter DMs and Facebook messages -- at least those are the possible ones that I have identified so far).
Right, so you need to make these events as you normally write your applications.
I need some flexible way to both specify the intervals and interpret the intervals so that the next event in a sequence can be specified in real time terms and scheduled.
And that's what dateutil.rrule is for.
-- Lennart Regebro, Colliberty: http://www.colliberty.com/ Telephone: +48 691 268 328
participants (3)
-
Brian Sullivan -
Lennart Regebro -
robert rottermann