|
|
@ -31,13 +31,13 @@ def add_item(): |
|
|
|
else: |
|
|
|
else: |
|
|
|
Order.add_item(options[chosen_item]) |
|
|
|
Order.add_item(options[chosen_item]) |
|
|
|
|
|
|
|
|
|
|
|
os.system('clear') |
|
|
|
print(chr(27) + "[2J") |
|
|
|
add_item() |
|
|
|
add_item() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def print_summary(): |
|
|
|
def print_summary(): |
|
|
|
print('Summary:') |
|
|
|
print('Summary:') |
|
|
|
summary = Order.get_string() |
|
|
|
summary = Order.get_summary_string() |
|
|
|
clipboard.copy(summary) |
|
|
|
clipboard.copy(summary) |
|
|
|
print(summary) |
|
|
|
print(summary) |
|
|
|
|
|
|
|
|
|
|
@ -46,6 +46,13 @@ def parse_ifood_string(): |
|
|
|
print('parse_ifood_string') |
|
|
|
print('parse_ifood_string') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def print_pdv(): |
|
|
|
|
|
|
|
pdvs = Order.get_order_pdv() |
|
|
|
|
|
|
|
str_pdvs = ','.join(map(str, pdvs)) |
|
|
|
|
|
|
|
clipboard.copy(str_pdvs) |
|
|
|
|
|
|
|
print(str_pdvs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def remove_latest_item(): |
|
|
|
def remove_latest_item(): |
|
|
|
Order.remove_latest_item() |
|
|
|
Order.remove_latest_item() |
|
|
|
|
|
|
|
|
|
|
@ -56,14 +63,14 @@ def clear_all_items(): |
|
|
|
|
|
|
|
|
|
|
|
main_menu_options = { |
|
|
|
main_menu_options = { |
|
|
|
'1': {'func': add_item, 'name': 'Add item'}, |
|
|
|
'1': {'func': add_item, 'name': 'Add item'}, |
|
|
|
'2': {'func': print_summary, 'name': 'Copy Summary/PDV to Clipboard'}, |
|
|
|
'2': {'func': print_summary, 'name': 'Copy Summary to Clipboard'}, |
|
|
|
'3': {'func': parse_ifood_string, 'name': 'Parse Ifood into PDVS'}, |
|
|
|
'3': {'func': print_pdv, 'name': 'Copy PDV to Clipboard'}, |
|
|
|
'4': {'func': remove_latest_item, 'name': 'Remove Last item'}, |
|
|
|
'4': {'func': parse_ifood_string, 'name': 'Parse Ifood into PDVS'}, |
|
|
|
'5': {'func': clear_all_items, 'name': 'Clear Order'}, |
|
|
|
'5': {'func': remove_latest_item, 'name': 'Remove Last item'}, |
|
|
|
'6': {'func': return_func, 'name': 'Exit'}, |
|
|
|
'6': {'func': clear_all_items, 'name': 'Clear Order'}, |
|
|
|
|
|
|
|
'7': {'func': return_func, 'name': 'Exit'}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def print_main_menu_options(): |
|
|
|
def print_main_menu_options(): |
|
|
|
print("Choose an Option:") |
|
|
|
print("Choose an Option:") |
|
|
|
for k, c in main_menu_options.items(): |
|
|
|
for k, c in main_menu_options.items(): |
|
|
|