Compare commits

..
6 Commits
Author SHA1 Message Date
mdipierro 1abdf72a04 2.9.4 2014-03-04 22:42:22 -06:00
mdipierro 7c536b66d0 Merge branch 'master' of github.com:web2py/web2py 2014-03-04 22:40:00 -06:00
mdipierro cc1c019216 Merge pull request #387 from apa-1/master
Added 'from_address' to allow for separation of 'envelope sender' and 'f...
2014-03-04 22:39:40 -06:00
mdipierro d20f231b34 fixed memdb anc session issue 1885 2014-03-04 22:33:50 -06:00
mdipierro 8b03bf5fd9 fixed gae_memacache issue 1887, thanks mjwatson 2014-03-04 22:28:35 -06:00
alex af4025731a Added 'from_address' to allow for separation of 'envelope sender' and 'from' in email 2014-03-04 13:10:08 -05:00
5 changed files with 22 additions and 10 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ update:
echo "remember that pymysql was tweaked" echo "remember that pymysql was tweaked"
src: src:
### Use semantic versioning ### 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 ### rm -f all junk files
make clean make clean
### clean up baisc apps ### clean up baisc apps
+1 -1
View File
@@ -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
+6 -2
View File
@@ -17,15 +17,19 @@ class MemcacheClient(object):
client = Client() client = Client()
def __init__(self, request): def __init__(self, request, default_time_expire = 300):
self.request = request self.request = request
self.default_time_expire = default_time_expire
def __call__( def __call__(
self, self,
key, key,
f, 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) key = '%s/%s' % (self.request.application, key)
value = None value = None
obj = self.client.get(key) obj = self.client.get(key)
+5 -2
View File
@@ -292,8 +292,11 @@ class Table(DALStorage):
def __str__(self): def __str__(self):
return self._tablename return self._tablename
def __call__(self, id): def __call__(self, id, **kwargs):
return self.get(id) record = self.get(id)
if kwargs and any(record[key]!=kwargs[key] for key in kwargs):
return None
return record
class Expression(object): class Expression(object):
+9 -4
View File
@@ -278,7 +278,8 @@ class Mail(object):
sender=None, sender=None,
encoding='utf-8', encoding='utf-8',
raw=False, raw=False,
headers={} headers={},
from_address=None
): ):
""" """
Sends an email using data specified in constructor 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 encoding: encoding of all strings passed to this method (including
message bodies) message bodies)
headers: dictionary of headers to refine the headers just before 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: Examples:
#Send plain text message to single address: #Send plain text message to single address:
@@ -655,7 +657,10 @@ class Mail(object):
# no cryptography process as usual # no cryptography process as usual
payload = payload_in 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[:] origTo = to[:]
if to: if to:
payload['To'] = encoded_or_raw(', '.join(to).decode(encoding)) payload['To'] = encoded_or_raw(', '.join(to).decode(encoding))