From 86199883e1cb52b765531e18f8a0bfb5b33e22f2 Mon Sep 17 00:00:00 2001 From: Error042 Date: Fri, 14 Oct 2022 11:32:48 +0200 Subject: [PATCH] Initial commit to new remote repo --- model.py | 14 +------------- view.py | 15 ++------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/model.py b/model.py index b9f8d2a..189815a 100644 --- a/model.py +++ b/model.py @@ -1,18 +1,6 @@ -''' -Created on Jun 03, 2022 - -@author: error042 -''' - class Model: - ''' - classdocs - ''' def __init__(self): - ''' - Constructor - ''' self.previous_value = '' self.value = '' self.operator = '' @@ -51,4 +39,4 @@ class Model: return self.value def _evaluate(self): - return eval(self.previous_value+self.operator+self.value) \ No newline at end of file + return eval(self.previous_value + self.operator + self.value) diff --git a/view.py b/view.py index aa12f7c..0115cce 100644 --- a/view.py +++ b/view.py @@ -1,20 +1,12 @@ -''' -Created on Jun 03, 2022 - -@author: error042 -''' import tkinter as tk from tkinter import ttk class View(tk.Tk): - ''' - classdocs - ''' PAD = 10 MAX_BUTTONS_PER_ROW = 4 - button_captions = [ + BUTTON_CAPTIONS = [ 'C', '+/-', '%', '/', 7, 8, 9, '*', 4, 5, 6, '-', @@ -23,9 +15,6 @@ class View(tk.Tk): ] def __init__(self, controller): - ''' - Constructor - ''' super().__init__() self.title('PyCalc') @@ -56,7 +45,7 @@ class View(tk.Tk): frm = ttk.Frame(outer_frm) frm.pack() - for buttons_in_row, caption in enumerate(self.button_captions): + for buttons_in_row, caption in enumerate(self.BUTTON_CAPTIONS): if buttons_in_row % self.MAX_BUTTONS_PER_ROW == 0: frm = ttk.Frame(outer_frm) frm.pack()