Skip to content

Commit

Permalink
Initialize GUI file
Browse files Browse the repository at this point in the history
  • Loading branch information
vdumoulin committed Dec 26, 2014
1 parent 2f38baf commit 9388863
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions gui.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 9388863

Please sign in to comment.