Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1abdf72a04 | ||
|
|
7c536b66d0 | ||
|
|
cc1c019216 | ||
|
|
d20f231b34 | ||
|
|
8b03bf5fd9 | ||
|
|
af4025731a |
@@ -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 @@
|
|||||||
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()
|
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)
|
||||||
|
|||||||
@@ -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
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user