common.py pep8 compliance

This commit is contained in:
Mathieu Comandon 2012-06-13 13:43:35 +02:00
parent 90f03878f2
commit 9b9112d5d7
1 changed files with 7 additions and 4 deletions

View File

@ -4,8 +4,8 @@ import random
import logging
from datetime import date
__all__ = [ 'PaymentCommon', 'URL', 'HTML', 'RANDOM', 'RECEIVED', 'ACCEPTED',
'PAID', 'ERROR' ]
__all__ = ['PaymentCommon', 'URL', 'HTML', 'RANDOM', 'RECEIVED', 'ACCEPTED',
'PAID', 'ERROR']
LOGGER = logging.getLogger(__name__)
@ -19,6 +19,7 @@ ACCEPTED = 2
PAID = 3
ERROR = 99
class PaymentResponse(object):
'''Holds a generic view on the result of payment transaction response.
@ -82,9 +83,11 @@ class PaymentCommon(object):
while True:
parts = [RANDOM.choice(choices) for x in range(length)]
id = ''.join(parts)
name = '%s_%s_%s' % (str(date.today()), '-'.join(prefixes), str(id))
name = '%s_%s_%s' % (str(date.today()),
'-'.join(prefixes), str(id))
try:
fd=os.open(os.path.join(self.PATH, name), os.O_CREAT|os.O_EXCL)
fd = os.open(os.path.join(self.PATH, name),
os.O_CREAT | os.O_EXCL)
except:
raise
else: