Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1abdf72a04 | ||
|
|
7c536b66d0 | ||
|
|
cc1c019216 | ||
|
|
d20f231b34 | ||
|
|
8b03bf5fd9 | ||
|
|
af4025731a |
2
Makefile
2
Makefile
@@ -30,7 +30,7 @@ update:
|
||||
echo "remember that pymysql was tweaked"
|
||||
src:
|
||||
### Use semantic versioning
|
||||
echo 'Version 2.9.3-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
||||
echo 'Version 2.9.4-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
||||
### rm -f all junk files
|
||||
make clean
|
||||
### clean up baisc apps
|
||||
|
||||
2
VERSION
2
VERSION
@@ -1 +1 @@
|
||||
Version 2.9.3-stable+timestamp.2014.03.03.08.49.54
|
||||
Version 2.9.4-stable+timestamp.2014.03.04.22.40.54
|
||||
|
||||
@@ -17,15 +17,19 @@ class MemcacheClient(object):
|
||||
|
||||
client = Client()
|
||||
|
||||
def __init__(self, request):
|
||||
def __init__(self, request, default_time_expire = 300):
|
||||
self.request = request
|
||||
self.default_time_expire = default_time_expire
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
key,
|
||||
f,
|
||||
time_expire=300,
|
||||
time_expire=None,
|
||||
):
|
||||
if time_expire is None:
|
||||
time_expire = self.default_time_expire
|
||||
|
||||
key = '%s/%s' % (self.request.application, key)
|
||||
value = None
|
||||
obj = self.client.get(key)
|
||||
|
||||
@@ -292,8 +292,11 @@ class Table(DALStorage):
|
||||
def __str__(self):
|
||||
return self._tablename
|
||||
|
||||
def __call__(self, id):
|
||||
return self.get(id)
|
||||
def __call__(self, id, **kwargs):
|
||||
record = self.get(id)
|
||||
if kwargs and any(record[key]!=kwargs[key] for key in kwargs):
|
||||
return None
|
||||
return record
|
||||
|
||||
class Expression(object):
|
||||
|
||||
|
||||
@@ -278,7 +278,8 @@ class Mail(object):
|
||||
sender=None,
|
||||
encoding='utf-8',
|
||||
raw=False,
|
||||
headers={}
|
||||
headers={},
|
||||
from_address=None
|
||||
):
|
||||
"""
|
||||
Sends an email using data specified in constructor
|
||||
@@ -308,8 +309,9 @@ class Mail(object):
|
||||
encoding: encoding of all strings passed to this method (including
|
||||
message bodies)
|
||||
headers: dictionary of headers to refine the headers just before
|
||||
sending mail, e.g. {'Return-Path' : 'bounces@example.org'}
|
||||
|
||||
sending mail, e.g. {'X-Mailer' : 'web2py mailer'}
|
||||
from_address: address to appear in the 'From:' header, this is not the
|
||||
envelope sender. If not specified the sender will be used
|
||||
Examples:
|
||||
|
||||
#Send plain text message to single address:
|
||||
@@ -655,7 +657,10 @@ class Mail(object):
|
||||
# no cryptography process as usual
|
||||
payload = payload_in
|
||||
|
||||
payload['From'] = encoded_or_raw(sender.decode(encoding))
|
||||
if from_address:
|
||||
payload['From'] = encoded_or_raw(from_address.decode(encoding))
|
||||
else:
|
||||
payload['From'] = encoded_or_raw(sender.decode(encoding))
|
||||
origTo = to[:]
|
||||
if to:
|
||||
payload['To'] = encoded_or_raw(', '.join(to).decode(encoding))
|
||||
|
||||
Reference in New Issue
Block a user