Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
odysseuskir committed Jan 14, 2023
1 parent b909d5c commit 2365db0
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
"""
Authors: Odysseus-Abraham Kirikopoulos
This script is protected by the GNU Public License 3.0. Refer source as "Odysseus-Abraham Kirikopoulos" when distributing the software.
Version: 1.7 Pre Build 2
Version: 1.7 Pre Build 3
"""

list_1 = {"task1": ["", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""],
"task5": ["", "", "", "", ""]} # Lists storing the tasks
list_1_name = "Not defined" # The list's name
list_1_name = None # The list's name
list_2 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""],
"task5": ["", "", "", "", ""]}
list_2_name = "Not defined"
list_2_name = None
list_3 = {"task1": ["", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""],
"task5": ["", "", "", "", ""]}
list_3_name = "Not defined"
operation_tree = "Not defined" # The selected operation parent from the user (Example: Delete is the parent of
# delete a task or a list)
operation = "Not defined" # The selected operation from the user
list_chosen = "Not defined" # The selected list to complete an operation
task_chosen = "Not defined" # The selected task to complete an operation
list_3_name = None
operation_tree = None # The selected operation parent from the user (Example: Delete is the parent of delete a task or a list)
operation = None # The selected operation from the user
list_chosen = None # The selected list to complete an operation
task_chosen = None # The selected task to complete an operation
subtask_chosen = 0 # The selected subtask to complete an operation


Expand Down Expand Up @@ -84,8 +83,8 @@ def subtask_select():


# Startup
print("To-Do List Copyright (C) 2022 Odysseus-Abraham Kirikopoulos\nThis program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it under certain conditions.") # Prints the GNU Public License 3.0
print("Build Version: 1.7 Pre Build 2\n\n") # Prints the build version
print("To-Do List GNU General Public License 3.0 2022 Odysseus-Abraham Kirikopoulos\nThis program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it under certain conditions.") # Prints the GNU Public License 3.0
print("Build Version: 1.7 Pre Build 3\n\n") # Prints the build version

# Greet
print("~~~ MY TO-DO LIST ~~~")
Expand All @@ -105,23 +104,23 @@ def subtask_select():
# Create a new list
if operation == "1":

if list_1_name == "Not defined": # Checking which list is not occupied in order to create a list
if list_1_name == None: # Checking which list is not occupied in order to create a list

list_1_name = input("\nName your new list: ")
print(f"{list_1_name} created")

elif list_2_name == "Not defined":
elif list_2_name == None:

list_2_name = input("\nName your new list: ")
print(f"{list_2_name} created")

elif list_3_name == "Not defined":
elif list_3_name == None:

list_3_name = input("\nName your new list: ")
print(f"{list_3_name} created")

elif (
list_1_name and list_2_name and list_3_name != "Not defined"): # In case there are 3 lists, no more can be created
list_1_name and list_2_name and list_3_name != None): # In case there are 3 lists, no more can be created

print("Err:MaxListsReached")

Expand Down Expand Up @@ -231,7 +230,7 @@ def subtask_select():

list_1_name = list_2_name # Moving the name of the second list to the first one
list_2_name = list_3_name # Moving the name of the third list to the second one
list_3_name = "Not defined" # Setting the name of the third list to "Not defined"
list_3_name = None # Setting the name of the third list to None
list_1 = list_2 # Moving the second list to the first one
list_2 = list_3 # Moving the third list to the second one
list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""],
Expand All @@ -242,15 +241,15 @@ def subtask_select():
elif list_chosen == list_2:

list_2_name = list_3_name
list_3_name = "Not defined"
list_3_name = None
list_2 = list_3
list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""],
"task4": ["", "", "", ""], "task5": ["", "", "", ""]}
print("List deleted successfully!")

elif list_chosen == list_3:

list_3_name = "Not defined"
list_3_name = None
list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""],
"task4": ["", "", "", ""], "task5": ["", "", "", ""]}
print("List deleted successfully!")
Expand Down

0 comments on commit 2365db0

Please sign in to comment.