From 9388863d87215abd6b50da47767a21e2c1680aaf Mon Sep 17 00:00:00 2001 From: Vincent Dumoulin Date: Fri, 26 Dec 2014 15:43:06 -0500 Subject: [PATCH] Initialize GUI file --- gui.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 gui.py diff --git a/gui.py b/gui.py new file mode 100644 index 0000000..f1fe64e --- /dev/null +++ b/gui.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +""" +Command-line interface for the register +""" +__authors__ = "Vincent Dumoulin" +__copyright__ = "Copyright 2014, Vincent Dumoulin" +__credits__ = ["Vincent Dumoulin"] +__license__ = "GPL v2" +__maintainer__ = "Vincent Dumoulin" +__email__ = "vincent.dumoulin@umontreal.ca" + +import argparse +from Tkinter import Tk, BOTH +from ttk import Frame, Style +from pyplanck.register import Register + + +class GUI(Frame): + def __init__(self, parent, register): + Frame.__init__(self, parent) + self.parent = parent + self.register = register + + self.parent.title("Caisse Planck") + self.style = Style() + self.pack(fill=BOTH, expand=1) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("-m", "--menu_path", help="path to the menu file", + type=str, default="sample_menu.txt") + parser.add_argument("-e", "--employees_path", help="path to the " + + "employees file", type=str, + default="sample_employees.txt") + parser.add_argument("-r", "--register_count_path", help="path to the " + + "register count file", type=str, + default="sample_register_count.bin") + parser.add_argument("-l", "--log_path", help="path to the " + + "directory of log files", type=str, + default="./") + args = parser.parse_args() + + menu_path = args.menu_path + employees_path = args.employees_path + register_count_path = args.register_count_path + log_path = args.log_path + + register = Register(menu_file_path=menu_path, + employees_file_path=employees_path, + register_count_file_path=register_count_path, + log_path=log_path) + + root = Tk() + root.geometry("600x600+300+300") + gui = GUI(root, register) + root.mainloop()