Compare commits

..

9 Commits

Author SHA1 Message Date
mdipierro
853beae9c6 R-2.9.9 2014-09-08 08:12:37 -05:00
mdipierro
94aab906d5 fixed serialization of Storage objects 2014-09-08 08:10:58 -05:00
mdipierro
bb3909a944 Merge pull request #490 from ilvalle/grid-fix
fix web2py.js with show_if and grid
2014-09-08 08:02:44 -05:00
mdipierro
99087ab37a R-2.9.8 2014-09-06 23:09:44 -05:00
mdipierro
4bcd905f4f fixed appadmin/check_credentials problem 2014-09-06 22:57:26 -05:00
mdipierro
83bda542ad fixed opening get_session for new session files 2014-09-06 18:10:54 -05:00
mdipierro
1ea27f7f15 linked readthedocs 2014-09-05 16:47:20 -05:00
ilvalle
7fa8f1fa08 fix web2py.js with show_if and grid 2014-09-05 16:17:36 +02:00
mdipierro
95b54857a3 fixed separator in trunk 2014-09-05 08:12:03 -05:00
13 changed files with 54 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
## 2.9.6-2.9.7
## 2.9.6 - 2.9.8
- fixed support of GAE + SQL
- fixed a typo in the license of some login_methods code. It is now LGPL consistently with the rest of the web2py code. This change applied to all previous web2py versions.

View File

@@ -30,7 +30,7 @@ update:
echo "remember that pymysql was tweaked"
src:
### Use semantic versioning
echo 'Version 2.9.7-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
echo 'Version 2.9.9-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
### rm -f all junk files
make clean
### clean up baisc apps

View File

@@ -6,7 +6,6 @@ It is written and programmable in Python. LGPLv3 License
Learn more at http://web2py.com
## Google App Engine deployment
cp examples/app.yaml ./
@@ -14,6 +13,10 @@ Learn more at http://web2py.com
Then edit ./app.yaml and replace "yourappname" with yourappname.
## Documentation (readthedocs.org)
[![Docs Status](https://readthedocs.org/projects/web2py/badge/?version=latest)](http://web2py.rtfd.org/)
## Tests
[![Build Status](https://travis-ci.org/web2py/web2py.png)](https://travis-ci.org/web2py/web2py)

View File

@@ -1 +1 @@
Version 2.9.7-stable+timestamp.2014.09.04.22.37.07
Version 2.9.9-stable+timestamp.2014.09.08.08.12.34

View File

@@ -545,8 +545,11 @@
};
$('[data-show-trigger]', target).each(function () {
var name = $(this).attr('data-show-trigger');
if(!triggers[name]) triggers[name] = [];
triggers[name].push($(this).attr('id'));
// The field exists only when creating/editing a row
if ($('#' + name).length) {
if(!triggers[name]) triggers[name] = [];
triggers[name].push($(this).attr('id'));
}
});
for(var name in triggers) {
$('#' + name, target).change(show_if).keyup(show_if);

View File

@@ -545,8 +545,11 @@
};
$('[data-show-trigger]', target).each(function () {
var name = $(this).attr('data-show-trigger');
if(!triggers[name]) triggers[name] = [];
triggers[name].push($(this).attr('id'));
// The field exists only when creating/editing a row
if ($('#' + name).length) {
if(!triggers[name]) triggers[name] = [];
triggers[name].push($(this).attr('id'));
}
});
for(var name in triggers) {
$('#' + name, target).change(show_if).keyup(show_if);

View File

@@ -545,8 +545,11 @@
};
$('[data-show-trigger]', target).each(function () {
var name = $(this).attr('data-show-trigger');
if(!triggers[name]) triggers[name] = [];
triggers[name].push($(this).attr('id'));
// The field exists only when creating/editing a row
if ($('#' + name).length) {
if(!triggers[name]) triggers[name] = [];
triggers[name].push($(this).attr('id'));
}
});
for(var name in triggers) {
$('#' + name, target).change(show_if).keyup(show_if);

View File

@@ -20,7 +20,7 @@ import datetime
import logging
from http import HTTP
from gzip import open as gzopen
from recfile import generate
__all__ = [
'parse_version',
@@ -400,6 +400,8 @@ def get_session(request, other_application='admin'):
session_id = request.cookies['session_id_' + other_application].value
session_filename = os.path.join(
up(request.folder), other_application, 'sessions', session_id)
if not os.path.exists(session_filename):
session_filename = generate(session_filename)
osession = storage.load_storage(session_filename)
except Exception, e:
osession = storage.Storage()

View File

@@ -1,12 +1,18 @@
import os, uuid
def generate(filename, depth=2, base=512):
if os.path.sep in filename:
path, filename = os.path.split(filename)
else:
path = None
dummyhash = sum(ord(c)*256**(i % 4) for i,c in enumerate(filename)) % base**depth
folders = []
for level in range(depth-1,-1,-1):
code, dummyhash = divmod(dummyhash, base**level)
folders.append("%03x" % code)
folders.append(filename)
if path:
folders.insert(0,path)
return os.path.join(*folders)
def exists(filename, path=None):

View File

@@ -1289,7 +1289,7 @@ class SQLFORM(FORM):
xfields.append(
(self.FIELDKEY_DELETE_RECORD + SQLFORM.ID_ROW_SUFFIX,
LABEL(
T(delete_label), separator,
T(delete_label), sep,
_for=self.FIELDKEY_DELETE_RECORD,
_id=self.FIELDKEY_DELETE_RECORD + \
SQLFORM.ID_LABEL_SUFFIX),

View File

@@ -13,6 +13,7 @@ Provides:
"""
import cPickle
import copy_reg
import gluon.portalocker as portalocker
__all__ = ['List', 'Storage', 'Settings', 'Messages',
@@ -129,6 +130,12 @@ class Storage(dict):
values = self.getlist(key)
return values[-1] if values else default
def pickle_storage(s):
return Storage, (dict(s),)
copy_reg.pickle(Storage, pickle_storage)
PICKABLE = (str, int, long, float, bool, list, dict, tuple, set)

View File

@@ -2710,7 +2710,8 @@ class Auth(object):
extra_fields = [
Field("password_two", "password", requires=IS_EQUAL_TO(
request.post_vars.get(passfield,None),
error_message=self.messages.mismatched_password))]
error_message=self.messages.mismatched_password),
label=current.T("Confirm Password"))]
else:
extra_fields = []
form = SQLFORM(table_user,

View File

@@ -29,6 +29,12 @@ Typical usage:
"""
from __future__ import with_statement
import sys
import os
print os.path.join(*__file__.split(os.sep)[:-2] or ['.'])
sys.path.append(os.path.join(*__file__.split(os.sep)[:-2] or ['.']))
from gluon import current
from gluon.storage import Storage
from optparse import OptionParser
@@ -37,6 +43,7 @@ import datetime
import os
import stat
import time
import glob
EXPIRATION_MINUTES = 60
SLEEP_MINUTES = 5
@@ -157,6 +164,9 @@ class SessionFile(object):
def delete(self):
try:
os.unlink(self.filename)
path = os.path.dirname(filename)
if not path.endswith('sessions') and len(os.listdir(path))==0:
os.rmdir(path)
except:
pass
@@ -191,10 +201,11 @@ def single_loop(expiration=None, force=False, verbose=False):
except:
expiration = EXPIRATION_MINUTES * 60
set_db = SessionSetDb(expiration, force, verbose)
set_files = SessionSetFiles(expiration, force, verbose)
set_db.trash()
set_files.trash()
set_db = SessionSetDb(expiration, force, verbose)
set_db.trash()
def main():
"""Main processing."""