Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
853beae9c6 | ||
|
|
94aab906d5 | ||
|
|
bb3909a944 | ||
|
|
99087ab37a | ||
|
|
4bcd905f4f | ||
|
|
83bda542ad | ||
|
|
1ea27f7f15 | ||
|
|
7fa8f1fa08 | ||
|
|
95b54857a3 |
@@ -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.
|
||||
|
||||
2
Makefile
2
Makefile
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
[](http://web2py.rtfd.org/)
|
||||
|
||||
## Tests
|
||||
|
||||
[](https://travis-ci.org/web2py/web2py)
|
||||
|
||||
2
VERSION
2
VERSION
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user