mirror of
https://bitbucket.org/presik/presik_pos.git
synced 2023-12-14 06:03:00 +01:00
43 lines
944 B
Python
43 lines
944 B
Python
#!/usr/bin/env python
|
|
# -*- coding: UTF-8 -*-
|
|
from re import compile
|
|
|
|
# States of mainwindow
|
|
STATES = {
|
|
'add': {
|
|
'button': 'button_accept',
|
|
're': compile(r'^(\*[0-9]*|[0-9]+)$|-|/|\*[0-9]*[.]*'),
|
|
},
|
|
'accept': {
|
|
'button': 'button_cash',
|
|
're': compile(r'^[0-9]+$'),
|
|
},
|
|
'payment': {
|
|
'button': 'button_payment',
|
|
're': compile(r'^[0-9]+$'),
|
|
},
|
|
'cash': {
|
|
'button': None,
|
|
're': compile(r'^[0-9]+(,[0-9]{,2})?$')
|
|
},
|
|
'paid': {
|
|
'button': None,
|
|
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
|
|
},
|
|
'cancel': {
|
|
'button': None,
|
|
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
|
|
},
|
|
'disabled': {
|
|
'button': None,
|
|
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
|
|
},
|
|
'finished': {
|
|
'button': None,
|
|
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
|
|
},
|
|
}
|
|
|
|
RE_SIGN = {
|
|
'quantity': compile(r'\d+|\.\d+|\d+\.'),
|
|
}
|