Skip to content
This repository was archived by the owner on May 29, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions data_entry_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ def __init__(self, parent, controller, pages):
self.enterData.place(x=500, y=600)

def only_numeric_input(self, e):
if e.isdigit():
return True
elif e == "":
return False
else:
return False
return bool(e.isdigit())
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DataScreen.only_numeric_input refactored with the following changes:

  • Merge duplicate blocks in conditional
  • Simplify conditional into return statement


def finalValidation(self):
marks = self.t4.get()
Expand Down
7 changes: 1 addition & 6 deletions init_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,4 @@ def submit(self):
self.controller.show_frame("DataScreen")

def only_numeric_input(self, e):
if e.isdigit():
return True
elif e == "":
return True
else:
return False
return bool(e.isdigit() or not e.isdigit() and e == "")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FirstScreen.only_numeric_input refactored with the following changes:

  • Merge duplicate blocks in conditional
  • Simplify conditional into return statement

14 changes: 2 additions & 12 deletions screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,7 @@ def submit():
continue_button.place(x=400, y=470, width=150, height=40)

def only_numeric_input(self, e):
if e.isdigit():
return True
elif e == "":
return True
else:
return False
return bool(e.isdigit() or not e.isdigit() and e == "")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FirstScreen.only_numeric_input refactored with the following changes:

  • Merge duplicate blocks in conditional
  • Simplify conditional into return statement


def all_children(self, window):
_list = window.winfo_children()
Expand Down Expand Up @@ -195,12 +190,7 @@ def submit():
enter_button.place(x=200, y=300, width=150, height=40)

def only_numeric_input(self, e):
if e.isdigit():
return True
elif e == "":
return True
else:
return False
return bool(e.isdigit() or not e.isdigit() and e == "")
Comment on lines -198 to +193
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SecondScreen.only_numeric_input refactored with the following changes:

  • Merge duplicate blocks in conditional
  • Simplify conditional into return statement



if __name__ == "__main__":
Expand Down