Browse Source

PEP8

pull/30/head
Alexis de Lattre 10 years ago
parent
commit
7907e2c960
  1. 19
      hw_telium_payment_terminal/controllers/main.py
  2. 19
      hw_telium_payment_terminal/test-scripts/telium-test.py
  3. 6
      pos_customer_display/pos_customer_display.py

19
hw_telium_payment_terminal/controllers/main.py

@ -156,16 +156,15 @@ class TeliumPaymentTerminalDriver(Thread):
'''We use protocol E+'''
ascii_names = curses.ascii.controlnames
real_msg = (
data['pos_number']
+ data['amount_msg']
+ data['answer_flag']
+ data['payment_mode']
+ data['transaction_type']
+ data['currency_numeric']
+ data['private']
+ data['delay']
+ data['auto']
)
data['pos_number'] +
data['amount_msg'] +
data['answer_flag'] +
data['payment_mode'] +
data['transaction_type'] +
data['currency_numeric'] +
data['private'] +
data['delay'] +
data['auto'])
logger.debug('Real message to send = %s' % real_msg)
assert len(real_msg) == 34, 'Wrong length for protocol E+'
real_msg_with_etx = real_msg + chr(ascii_names.index('ETX'))

19
hw_telium_payment_terminal/test-scripts/telium-test.py

@ -115,16 +115,15 @@ def send_message(serial, data):
'''We use protocol E+'''
ascii_names = curses.ascii.controlnames
real_msg = (
data['pos_number']
+ data['amount_msg']
+ data['answer_flag']
+ data['payment_mode']
+ data['transaction_type']
+ data['currency_numeric']
+ data['private']
+ data['delay']
+ data['auto']
)
data['pos_number'] +
data['amount_msg'] +
data['answer_flag'] +
data['payment_mode'] +
data['transaction_type'] +
data['currency_numeric'] +
data['private'] +
data['delay'] +
data['auto'])
print 'Real message to send = %s' % real_msg
assert len(real_msg) == 34, 'Wrong length for protocol E+'
real_msg_with_etx = real_msg + chr(ascii_names.index('ETX'))

6
pos_customer_display/pos_customer_display.py

@ -59,10 +59,12 @@ class PosConfig(models.Model):
if self.customer_display_line_length:
maxsize = self.customer_display_line_length
to_check = {
_('Next Customer (top line)'): self.customer_display_msg_next_l1,
_('Next Customer (top line)'):
self.customer_display_msg_next_l1,
_('Next Customer (bottom line)'):
self.customer_display_msg_next_l2,
_('POS Closed (top line)'): self.customer_display_msg_closed_l1,
_('POS Closed (top line)'):
self.customer_display_msg_closed_l1,
_('POS Closed (bottom line)'):
self.customer_display_msg_closed_l2,
}

Loading…
Cancel
Save