[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread Brian M
Massimo, In trunk your check for Windows should be platform.system() == 'Windows' and not platform.systems() = 'Windows' You've got an extra s in there. I don't know that you need to disable it for windows as a whole or just for the binary distro of web2py. I have to do more testing. Also, I

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread mdipierro
I think I addresses two of the issues. Please take a look. Thanks again for all your help. Massimo On Jan 31, 11:24 am, Brian M bmere...@gmail.com wrote: Massimo, In trunk your check for Windows should be platform.system() == 'Windows' and not platform.systems() = 'Windows' You've got

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread Brian M
Yes, that mostly fixes things. However, you still need an explicit test for the @reboot or it won't ever run, check won't have a -1 minute in it. I am testing out a modified cron.py with all of the fixes we've covered in this thread plus the checks for whether or not a task should be run split

Re: [web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread Jonathan Lundell
On Jan 31, 2010, at 11:20 AM, Brian M wrote: Yes, that mostly fixes things. However, you still need an explicit test for the @reboot or it won't ever run, check won't have a -1 minute in it. I am testing out a modified cron.py with all of the fixes we've covered in this thread plus the

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread mdipierro
The fact is, there are different types of cron but this variable is used only in the case soft. This is a global var and it should go away. The value should go in settings. The logic should depend on the value of this variable. On Jan 31, 1:47 pm, Jonathan Lundell jlund...@pobox.com wrote: On

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread AchipA
I'm also workin on refactoring a few things in cron, let's not trip over each other :) I see people have been busy with my code so there are more things to check than I initially thought, but I'm still on track. I also plan on including a test module which will make regression tests easier. On

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread mdipierro
I can stop making changes. Please make sure your changes apply to latest trunk. On Jan 31, 5:19 pm, AchipA attila.cs...@gmail.com wrote: I'm also workin on refactoring a few things in cron, let's not trip over each other :) I see people have been busy with my code so there are more things to

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread Brian M
I just tried trunk cron on Linux and it does NOT seem to be working. Oddly, debugging is showing DEBUG:root:WEB2PY CRON Call retruned success: but it does not appear the tasks are actually running. I've got a cron_test app setup with controller functions to write a message to both a file and

Re: [web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Thadeus Burgess
in windows? c:\python25\python.exe its not case sensitive but it is slash sensitive -Thadeus On Sat, Jan 30, 2010 at 12:24 AM, mdipierro mdipie...@cs.depaul.edu wrote: Would this path be right c:/Python25/python.exe or this c:\Python25\python.exe or both? On Jan 29, 11:18 pm,

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread mdipierro
The problem is when paths contain spaces. I thought even in windows in this case one should esacpe spaces with '\ ' and use either \\ ('' in python) or / ('/') to separate folders. For example: 'C:/windows/Documents\ and\ Settings/' or 'C:\\windows\\Documents\ and\ Settings\\' Am I wrong?

Re: [web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Jonathan Lundell
On Jan 30, 2010, at 1:40 PM, mdipierro wrote: The problem is when paths contain spaces. I thought even in windows in this case one should esacpe spaces with '\ ' and use either \\ ('' in python) or / ('/') to separate folders. For example: 'C:/windows/Documents\ and\ Settings/' or

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread mdipierro
I replace the Popen(command) with Popen(list_of_args) and this (according to some) should fix the escaping problem. Needs testing. Massimo On Jan 30, 4:50 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jan 30, 2010, at 1:40 PM, mdipierro wrote: The problem is when paths contain spaces.

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
Well on my Win7 setup with source distribution of web2py I can confirm that @reboot cron lines do not run when I start up web2py. The same cron line with a normal time declaration does run just fine. #...@reboot does not run @reboot * * * * root *reboot/on_reboot #But with

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread mdipierro
which version? Please give me the version timestamp as shown in the main admin interface. On Jan 30, 5:39 pm, Brian M bmere...@gmail.com wrote: Well on my Win7 setup with source distribution of web2py I can confirm that @reboot cron lines do not run when I start up web2py. The same cron line

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread mdipierro
Can you please try this? http://web2py.com/examples/static/web2py_win_check.zip try with cron, @reboot and with web2py in a path that contains spaces (the main issue). On Jan 30, 5:39 pm, Brian M bmere...@gmail.com wrote: Well on my Win7 setup with source distribution of web2py I can confirm

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
OK, just pulled latest trunk out of the google code hg repo and @reboot seems to be working on Win7 - actually it's working a bit too good. Not only does it run on web2py startup, but it CONTINUES to run once a minute from then on! I did notice that I had the @reboot crontab syntax wrong

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
Massimo, With your web2py_win_check.zip version, placed in a path containing spaces I get: C:\Users\Brian\Documents\development\web2py\web2py win check \web2pyweb2py.exe web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2010 Version 1.74.8 (2010-01-30 19:00:11)

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread mdipierro
Hi Brian, can you help me debug this. In gluon/contrib/cron.py there is a line in function crondance: elif not startup and task.get('min',[])==[-1]: continue @reboot startup is supposed to be true the first time only and task.get ('min',[]) is supposed to be ==[-1].

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
Massimo, The problem is in def parsecronline() there needs to be an extra elif clause to deal with that -1 minute value for @reboot tasks. for (s, id) in zip(params[:5], ['min', 'hr', 'dom', 'mon', 'dow']): if not s in [None, '*']: task[id] = [] vals =

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread mdipierro
fantastic. I am uploading the fix to trunk. Please make sure I did not mess it up. I very much appreciate your help. On Jan 30, 8:46 pm, Brian M bmere...@gmail.com wrote: Massimo, The problem is in def parsecronline() there needs to be an extra elif clause to deal with that -1 minute value

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
I think I may have a solution to the windows binary's problem with spaces in file paths. It seems that Windows doesn't like shell=True in Popen(). I'm thinking that checking if we're running web2py.exe or web2py_no_console.exe and if so setting shell=False should do it. I've got what seems to be a

[web2py] Re: has anybody check the the cron in trunk?

2010-01-29 Thread mr.freeze
No but I'm getting this in the console on Windows 7: WARNING:root:WEB2PY CRON Call returned code 1: 'c:/Python25/python.exe\' is not recognized as an internal or external command, operable program or batch file. On Jan 29, 5:37 pm, mdipierro mdipie...@cs.depaul.edu wrote: In particular on

[web2py] Re: has anybody check the the cron in trunk?

2010-01-29 Thread mdipierro
Would this path be right c:/Python25/python.exe or this c:\Python25\python.exe or both? On Jan 29, 11:18 pm, mr.freeze nat...@freezable.com wrote: No but I'm getting this in the console on Windows 7: WARNING:root:WEB2PY CRON Call returned code 1: 'c:/Python25/python.exe\' is not