reverted Pickleable until we understand it better

This commit is contained in:
Massimo Di Pierro
2011-12-17 22:07:36 -06:00
parent 34461c0ee1
commit e66fb147dd
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.4 (2011-12-17 12:58:11) stable
Version 1.99.4 (2011-12-17 22:07:17) stable
+4 -4
View File
@@ -41,8 +41,8 @@ regex_link = re.compile('\[\[(?P<t>[^\]]*?) +(?P<k>\S+)\]\]')
regex_auto = re.compile('(?<!["\w])(?P<k>\w+://[\w\.\-\?&%\:]+)',re.M)
regex_commas = re.compile('[ ]+(?P<t>[,;\.])')
regex_noindent = re.compile('\n\n(?P<t>[a-z])')
regex_quote_left = re.compile('"(?=\w)')
regex_quote_right = re.compile('(?=\w\.)"')
#regex_quote_left = re.compile('"(?=\w)')
#regex_quote_right = re.compile('(?=\w\.)"')
def latex_escape(text,pound=True):
text=text.replace('\\','{\\textbackslash}')
@@ -139,8 +139,8 @@ def render(text,extra={},allowed={},sep='p',image_mapper=lambda x:x):
match=regex.search(text)
if not match: break
text=text[:match.start()]+text[match.start()+1:]
text = regex_quote_left.sub('``',text)
text = regex_quote_right.sub("''",text)
#text = regex_quote_left.sub('``',text)
#text = regex_quote_right.sub("''",text)
#############################################################
# process all code text
+1 -1
View File
@@ -157,7 +157,7 @@ class Storage(dict):
return None
PICKABLE = (str,int,long,float,bool,list,dict,tuple,set)
def PickeableStorage(data):
def PickleableStorage(data):
return Storage(dict((k,v) for (k,v) in data.items() if isinstance(v,PICKABLE)))
class StorageList(Storage):
+3 -3
View File
@@ -24,7 +24,7 @@ import cStringIO
from email import MIMEBase, MIMEMultipart, MIMEText, Encoders, Header, message_from_string
from contenttype import contenttype
from storage import Storage, PickeableStorage, StorageList, Settings, Messages
from storage import Storage, PickleableStorage, StorageList, Settings, Messages
from utils import web2py_uuid
from fileutils import read_file
from gluon import *
@@ -1494,7 +1494,7 @@ class Auth(object):
if user:
password = table_user[passfield].validate(password)[0]
if not user.registration_key and user[passfield] == password:
user = PickeableStorage(user)
user = Storage(table_user._filter_fields(user, id=True))
session.auth = Storage(user=user, last_visit=request.now,
expiration=self.settings.expiration,
hmac_key = web2py_uuid())
@@ -1771,7 +1771,7 @@ class Auth(object):
# process authenticated users
if user:
user = PickeableStorage(user)
user = Storage(table_user._filter_fields(user, id=True))
# process authenticated users
# user wants to be logged in for longer