Support Python 3 using six

This commit is contained in:
David Baumgold 2014-08-26 13:25:50 -04:00
commit eedb4c4b73
67 changed files with 455 additions and 255 deletions

View file

@ -30,7 +30,7 @@ class Message(object):
@property
def md5(self):
body_md5 = hashlib.md5()
body_md5.update(self.body)
body_md5.update(self.body.encode('utf-8'))
return body_md5.hexdigest()
def mark_sent(self, delay_seconds=None):

View file

@ -7,7 +7,7 @@ import string
def generate_receipt_handle():
# http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/ImportantIdentifiers.html#ImportantIdentifiers-receipt-handles
length = 185
return ''.join(random.choice(string.lowercase) for x in range(length))
return ''.join(random.choice(string.ascii_lowercase) for x in range(length))
def unix_time(dt=None):