Compare commits

..

6 Commits

Author SHA1 Message Date
mdipierro
e4b6fba5ca R-2.0.5 2012-08-31 16:28:40 -05:00
mdipierro
41caa71ab0 scheduler validators, thanks Niphlod 2012-08-31 16:15:59 -05:00
mdipierro
f8786e5b6d 2.0.5 2012-08-31 16:11:56 -05:00
mdipierro
78b5f4f8aa better timezone logic 2012-08-31 16:04:13 -05:00
mdipierro
a0e4154f26 better timezone logic 2012-08-31 16:00:23 -05:00
mdipierro
3f7749cf20 R-2.0.4 2012-08-31 15:38:37 -05:00
5 changed files with 42 additions and 16 deletions

View File

@@ -29,7 +29,7 @@ update:
wget -O gluon/contrib/simplejsonrpc.py http://rad2py.googlecode.com/hg/ide2py/simplejsonrpc.py
echo "remember that pymysql was tweaked"
src:
echo 'Version 2.0.3 ('`date +%Y-%m-%d\ %H:%M:%S`') stable' > VERSION
echo 'Version 2.0.5 ('`date +%Y-%m-%d\ %H:%M:%S`') stable' > VERSION
### rm -f all junk files
make clean
### clean up baisc apps

View File

@@ -1 +1 @@
Version 2.0.3 (2012-08-31 14:27:45) stable
Version 2.0.5 (2012-08-31 16:28:37) stable

View File

@@ -1793,18 +1793,18 @@ class BaseAdapter(ConnectionPool):
def parse_datetime(self, value, field_type):
if not isinstance(value, datetime.datetime):
if '+' in value:
value,tz = value.split('+')
value = str(value)
date_part,time_part,timezone = value[:10],value[11:19],value[19:]
if '+' in timezone:
ms,tz = timezone.split('+')
h,m = tz.split(':')
dt = datetime.timedelta(seconds=3600*int(h)+60*int(m))
elif '-' in value:
value,tz = value.split('-')
elif '-' in timezone:
ms,tz = timezone.split('-')
h,m = tz.split(':')
dt = -datetime.timedelta(seconds=3600*int(h)+60*int(m))
else:
dt = None
date_part, time_part = (
str(value).replace('T',' ')+' ').split(' ',1)
(y, m, d) = map(int,date_part.split('-'))
time_parts = time_part and time_part.split(':')[:3] or (0,0,0)
while len(time_parts)<3: time_parts.append(0)

View File

@@ -88,7 +88,7 @@ except:
from simplejson import loads, dumps
from gluon import DAL, Field, IS_NOT_EMPTY, IS_IN_SET, IS_NOT_IN_DB
from gluon import DAL, Field, IS_NOT_EMPTY, IS_IN_SET, IS_NOT_IN_DB, IS_INT_IN_RANGE
from gluon.utils import web2py_uuid
@@ -454,15 +454,20 @@ class Scheduler(MetaScheduler):
Field('args','text',default='[]',requires=TYPE(list)),
Field('vars','text',default='{}',requires=TYPE(dict)),
Field('enabled','boolean',default=True),
Field('start_time','datetime',default=now),
Field('start_time','datetime',default=now, requires=IS_NOT_EMPTY()),
Field('next_run_time','datetime',default=now),
Field('stop_time','datetime'),
Field('repeats','integer',default=1,comment="0=unlimited"),
Field('retry_failed', 'integer', default=0, comment="-1=unlimited"),
Field('period','integer',default=60,comment='seconds'),
Field('timeout','integer',default=60,comment='seconds'),
Field('repeats','integer',default=1,comment="0=unlimited",
requires=IS_INT_IN_RANGE(0, None)),
Field('retry_failed', 'integer', default=0, comment="-1=unlimited",
requires=IS_INT_IN_RANGE(-1, None)),
Field('period','integer',default=60,comment='seconds',
requires=IS_INT_IN_RANGE(0, None)),
Field('timeout','integer',default=60,comment='seconds',
requires=IS_INT_IN_RANGE(0, None)),
Field('sync_output', 'integer', default=0,
comment="update output every n sec: 0=never"),
comment="update output every n sec: 0=never",
requires=IS_INT_IN_RANGE(0, None)),
Field('times_run','integer',default=0,writable=False),
Field('times_failed','integer',default=0,writable=False),
Field('last_run_time','datetime',writable=False,readable=False),
@@ -870,4 +875,3 @@ def main():
if __name__=='__main__':
main()

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unit tests for running web2py
"""
import sys
import os
if os.path.isdir('gluon'):
sys.path.append(os.path.realpath('gluon'))
else:
sys.path.append(os.path.realpath('../'))
import unittest
from gluon.contrib.markmin.markmin2html import run_doctests
class TestMarkmin(unittest.TestCase):
def testMarkmin(self):
run_doctests()
if __name__ == '__main__':
unittest.main()