From dd9c12503fecc5c190b02824c071964d950d6c7e Mon Sep 17 00:00:00 2001 From: Odysseus-Abraham Kirikopoulos Date: Sat, 5 Nov 2022 13:08:20 +0200 Subject: [PATCH 01/10] File optimizations --- main.py | 409 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 209 insertions(+), 200 deletions(-) diff --git a/main.py b/main.py index dd1c6fc..1ab737f 100644 --- a/main.py +++ b/main.py @@ -1,309 +1,318 @@ -''' +""" 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.6.1 Stable -''' - -list_1 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], "task5": ["", "", "", ""]} #Lists storing the tasks -list_1_name = "Not defined" #The list's name -list_2 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], "task5": ["", "", "", ""]} +Version: 1.7 Pre Build 1 +""" + +list_1 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], + "task5": ["", "", "", ""]} # Lists storing the tasks +list_1_name = "Not defined" # The list's name +list_2 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], + "task5": ["", "", "", ""]} list_2_name = "Not defined" -list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], "task5": ["", "", "", ""]} +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 -subtask_chosen = 0 #The selected subtask to complete an operation +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 +subtask_chosen = 0 # The selected subtask to complete an operation + + +def refresh_pr_list(): # Refreshes the list of tasks + + global print_task_l1 + global print_task_l2 + global print_task_l3 + + print_task_l1 = f"\nTask 1: {list_1['task1'][0]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" + print_task_l2 = f"\nTask 1: {list_2['task1'][0]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" + print_task_l3 = f"\nTask 1: {list_3['task1'][0]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" + -def refresh_pr_list(): #Refreshes the list of tasks +def list_select(): # Allows the user to select a list - global print_task_l1 - global print_task_l2 - global print_task_l3 + global list_chosen - print_task_l1 = f"\nTask 1: {list_1['task1'][0]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" - print_task_l2 = f"\nTask 1: {list_2['task1'][0]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" - print_task_l3 = f"\nTask 1: {list_3['task1'][0]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" + list_chosen = str(input(f"\nSelect a list\n[{list_1_name}]\n[{list_2_name}]\n[{list_3_name}]\n")) + if list_chosen == list_1_name: + list_chosen = list_1 -def list_select(): #Allows the user to select a list + elif list_chosen == list_2_name: + list_chosen = list_2 - global list_chosen + elif list_chosen == list_3_name: + list_chosen = list_3 - list_chosen = str(input(f"\nSelect a list\n[{list_1_name}]\n[{list_2_name}]\n[{list_3_name}]\n")) + else: + print("Err:ListNotFound") - if list_chosen == list_1_name: - list_chosen = list_1 - - elif list_chosen == list_2_name: - list_chosen = list_2 - elif list_chosen == list_3_name: - list_chosen = list_3 +def task_select(): # Allows the user to select a task - else: - print("Err:ListNotFound") + global task_chosen -def task_select(): #Allows the user to select a task + list_select() - global task_chosen + if list_chosen == list_1: - list_select() - - if list_chosen == list_1: + task_chosen = input(f"\nSelect a task: {print_task_l1}\n") - task_chosen = input(f"\nSelect a task: {print_task_l1}\n") - - elif list_chosen == list_2: + elif list_chosen == list_2: - task_chosen = input(f"\nSelect a task: {print_task_l2}\n") + task_chosen = input(f"\nSelect a task: {print_task_l2}\n") - elif list_chosen == list_3: + elif list_chosen == list_3: - task_chosen = input(f"\nSelect a task: {print_task_l3}\n") + task_chosen = input(f"\nSelect a task: {print_task_l3}\n") + + else: + print("Err:ListNotFound") - else: - print("Err:ListNotFound") def subtask_select(): + global subtask_chosen - global subtask_chosen + task_select() - task_select() + subtask_chosen = input(f"\nSelect a subtask:\n") - subtask_chosen = input(f"\nSelect a subtask:\n") + subtask_chosen = int(subtask_chosen) - subtask_chosen = int(subtask_chosen) -#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.6.1 Stable\n\n") #Prints the build version +# 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 1\n\n") # Prints the build version -#Greet +# Greet print("~~~ MY TO-DO LIST ~~~") -#Operations -while True: #Infinete loop - - operation_tree = input("\nSelect the type of operation:\n(1) Create\n(2) Delete/Check off\n(3) Rename\n(4) View\nTo exit press 0\n\n") #Asks the user to select an operation +# Operations +while True: # Infinite loop + + operation_tree = input( + "\nSelect the type of operation:\n(1) Create\n(2) Delete/Check off\n(3) Rename\n(4) View\nTo exit press 0\n\n") # Asks the user to select an operation + + if operation_tree == "0": # User exiting + break + + elif operation_tree == "1": # User creating a list or a (sub)task + operation = input("\n -> (1) Create a list\n -> (2) Create a task\n -> (3) Create a subtask\n\n") + + # Create a new list + if operation == "1": - if operation_tree == "0": #User exiting - break + if list_1_name == "Not defined": # Checking which list is not occupied in order to create a list - elif operation_tree == "1": #User creating a list or a (sub)task - operation = input("\n -> (1) Create a list\n -> (2) Create a task\n(3) -> Create a subtask\n\n") + list_1_name = input("\nName your new list: ") + print(f"{list_1_name} created") - #Create a new list - if operation == "1": + elif list_2_name == "Not defined": - if(list_1_name == "Not defined"): #Checking which list is not occupied in order to create a list + list_2_name = input("\nName your new list: ") + print(f"{list_2_name} created") - list_1_name = input("\nName your new list: ") - print(f"{list_1_name} created") + elif list_3_name == "Not defined": - elif(list_2_name == "Not defined"): + list_3_name = input("\nName your new list: ") + print(f"{list_3_name} created") - list_2_name = input("\nName your new list: ") - print(f"{list_2_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 - elif(list_3_name == "Not defined"): + print("Err:MaxListsReached") - list_3_name = input("\nName your new list: ") - print(f"{list_3_name} created") + refresh_pr_list() - 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 + # Create a new task + elif operation == "2": - print("Err:MaxListsReached") + list_select() - refresh_pr_list() + if list_chosen["task1"][0] == "": # Checking a non-occupied task to create the new one - #Create a new task - elif operation == "2": + list_chosen["task1"][0] = input("\nEnter your task: ") + print("\nTask created successfully!") - list_select() + elif list_chosen["task2"][0] == "": - if list_chosen["task1"][0] == "": #Checking an non-occupied task to create the new one + list_chosen["task2"][0] = input("\nEnter your task: ") + print("\nTask created successfully!") - list_chosen["task1"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + elif list_chosen["task3"][0] == "": - elif list_chosen["task2"][0] == "": + list_chosen["task3"][0] = input("\nEnter your task: ") + print("\nTask created successfully!") - list_chosen["task2"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + elif list_chosen["task4"][0] == "": - elif list_chosen["task3"][0] == "": + list_chosen["task4"][0] = input("\nEnter your task: ") + print("\nTask created successfully!") - list_chosen["task3"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + elif list_chosen["task5"][0] == "": - elif list_chosen["task4"][0] == "": + list_chosen["task5"][0] = input("\nEnter your task: ") + print("\nTask created successfully!") - list_chosen["task4"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + else: - elif list_chosen["task5"][0] == "": + print("\nErr:MaxTasksReached") # In case there are 5 tasks, no more can be created - list_chosen["task5"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + refresh_pr_list() - else: + # Create a subtask + elif operation == "3": - print("\nErr:MaxTasksReached") #In case there are 5 tasks, no more can be created + task_select() - refresh_pr_list() + if list_chosen[task_chosen][1] == "": # Checking non-occupied subtask to create the new one - #Create a subtask - elif operation == "3": + list_chosen[task_chosen][1] = input("\nEnter your task: ") + print("\nSubtask created successfully!") - task_select() + elif list_chosen[task_chosen][2] == "": - if list_chosen[task_chosen][1] == "": #Checking an non-occupied subtask to create the new one + list_chosen[task_chosen][2] = input("\nEnter your task: ") + print("\nSubtask created successfully!") - list_chosen[task_chosen][1] = input("\nEnter your task: ") - print("\nSubtask created successfully!") + elif list_chosen[task_chosen][3] == "": - elif list_chosen[task_chosen][2] == "": + list_chosen[task_chosen][3] = input("\nEnter your task: ") + print("\nSubtask created successfully!") - list_chosen[task_chosen][2] = input("\nEnter your task: ") - print("\nSubtask created successfully!") + else: # In case there are 3 subtasks, no more can be created - elif list_chosen[task_chosen][3] == "": + print("\nErr:MaxSubtasksReached") - list_chosen[task_chosen][3] = input("\nEnter your task: ") - print("\nSubtask created successfully!") + refresh_pr_list() - else: #In case there are 3 subtasks, no more can be created + if operation_tree == "2": # User deleting/checking off a list or a (sub)task - print("\nErr:MaxSubtasksReached") + operation = input( + "\n -> (1) Check off a task\n -> (2) Check off a subtask\n -> (3) Delete a list\n -> (4) Delete a task\n\n") - refresh_pr_list() + # Check off a task + if operation == "1": + task_select() - if operation_tree == "2": #User deleting/checking off a list or a (sub)task + list_chosen[task_chosen][0] += " [Done]" # Adding "[Done]" to the end of the selected task + print("Task checked off successfully!") - operation = input("\n -> (1) Check off a task\n -> (2) Check off a subtask\n -> (3) Delete a list\n -> (4) Delete a task\n\n") + refresh_pr_list() - #Chech off a task - if operation == "1": + # Check off a subtask + if operation == "2": + subtask_select() - task_select() + list_chosen[task_chosen][subtask_chosen] += " [Done]" # Adding "[Done]" to the end of the selected subtask + print("Subtask checked off successfully!") - list_chosen[task_chosen][0] += " [Done]" #Adding "[Done]" to the end of the selected task - print("Task checked off successfully!") + refresh_pr_list() - refresh_pr_list() + # Delete a list + if operation == "3": - #Check off a subtask - if operation == "2": + list_select() - subtask_select() + if list_chosen == list_1: - list_chosen[task_chosen][subtask_chosen] += " [Done]" #Adding "[Done]" to the end of the selected subtask - print("Subtask checked off successfully!") + 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_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": ["", "", "", ""], + "task4": ["", "", "", ""], + "task5": ["", "", "", ""]} # Setting the third list to a default one + print("List deleted successfully!") - refresh_pr_list() + elif list_chosen == list_2: - #Delete a list - if operation == "3": + list_2_name = list_3_name + list_3_name = "Not defined" + list_2 = list_3 + list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], + "task4": ["", "", "", ""], "task5": ["", "", "", ""]} + print("List deleted successfully!") - list_select() + elif list_chosen == list_3: - if list_chosen == list_1: + list_3_name = "Not defined" + list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], + "task4": ["", "", "", ""], "task5": ["", "", "", ""]} + print("List deleted successfully!") - 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_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":["","","",""],"task4":["","","",""],"task5":["","","",""]} #Setting the third list to a default one - print("List deleted successfully!") + else: - elif list_chosen == list_2: + print("Err:ListNotFound") - list_2_name = list_3_name - list_3_name = "Not defined" - list_2 = list_3 - list_3 = {"task1":["","","",""],"task2":["","","",""],"task3":["","","",""],"task4":["","","",""],"task5":["","","",""]} - print("List deleted successfully!") + refresh_pr_list() - elif list_chosen == list_3: + # Delete a task + if operation == "4": + task_select() - list_3_name = "Not defined" - list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], "task5": ["", "", "", ""]} - print("List deleted successfully!") + list_chosen[task_chosen][0] = "" # Setting a task blank + list_chosen[task_chosen][1] = "" + list_chosen[task_chosen][2] = "" + list_chosen[task_chosen][3] = "" - else: + refresh_pr_list() - print("Err:ListNotFound") + if operation_tree == "3": # User editing a list or a task - refresh_pr_list() + operation = input("\n -> (1) Rename a list\n -> (2) Rename a task\n\n") - #Delete a task - if operation == "4" : - - task_select() + # Rename a list + if operation == "1": - list_chosen[task_chosen][0] = "" #Setting a task blank - list_chosen[task_chosen][1] = "" - list_chosen[task_chosen][2] = "" - list_chosen[task_chosen][3] = "" + list_select() - refresh_pr_list() + if list_chosen == list_1: # Renaming the list + list_1_name = input(f"\nRename the list (previous name: {list_1_name}):\n") + print("Renamed the list successfully!") - if operation_tree == "3": #User editing a list or a task + elif list_chosen == list_2: + list_2_name = input(f"\nRename the list (previous name: {list_2_name}):\n") + print("Renamed the list successfully!") - operation = input("\n -> (1) Rename a list\n -> (2) Rename a task\n\n") - - #Rename a list - if operation == "1": + elif list_chosen == list_3: + list_3_name = input(f"\nRename the list (previous name: {list_3_name}):\n") + print("Renamed the list successfully!") - list_select() + else: + print("\nErr:ListNotFound") - if list_chosen == list_1: #Renaming the list - list_1_name = input(f"\nRename the list (previous name: {list_1_name}):\n") - print("Renamed the list successfuly!") + refresh_pr_list() - elif list_chosen == list_2: - list_2_name = input(f"\nRename the list (previous name: {list_2_name}):\n") - print("Renamed the list successfuly!") - - elif list_chosen == list_3: - list_3_name = input(f"\nRename the list (previous name: {list_3_name}):\n") - print("Renamed the list successfuly!") + # Rename a task + if operation == "2": + task_select() - else: - print("\nErr:ListNotFound") + list_chosen[task_chosen][0] = input(f"Rename the task: ") # Renaming the task + print("Renamed the task successfully!") - refresh_pr_list() - - #Rename a task - if operation == "2": - - task_select() + refresh_pr_list() - list_chosen[task_chosen][0] = input(f"Rename the task: ") #Renaming the task - print("Renamed the task successfuly!") + if operation_tree == "4": # User viewing a list - refresh_pr_list() + list_select() - if operation_tree == "4": #User viewing a list - - list_select() + if list_chosen == list_1: # Printing the list selected + print(print_task_l1) - if list_chosen == list_1: #Printing the list selected - print(print_task_l1) - - elif list_chosen == list_2: - print(print_task_l2) + elif list_chosen == list_2: + print(print_task_l2) - elif list_chosen == list_3: - print(print_task_l3) + elif list_chosen == list_3: + print(print_task_l3) - else: - print("Err:ListNotFound") - -exit_key = input() #Exiting the program + else: + print("Err:ListNotFound") +exit_key = input() # Exiting the program -#This program is protected by the GNU General Public License v3.0 | ODYSSEUS-ABRAHAM KIRIKOPOULOS | 2022 | SOME RIGHTS RESERVED \ No newline at end of file +# This program is protected by the GNU General Public License v3.0 | ODYSSEUS-ABRAHAM KIRIKOPOULOS | 2022 | SOME RIGHTS RESERVED From ee7c044ef1a86cacd3608543219fd8107112345b Mon Sep 17 00:00:00 2001 From: Odysseus-Abraham Kirikopoulos Date: Sat, 5 Nov 2022 13:08:46 +0200 Subject: [PATCH 02/10] Commit --- .idea/.gitignore | 8 ++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/todo-list.iml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 6 files changed, 40 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/todo-list.iml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..dc9ea49 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..48f1900 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/todo-list.iml b/.idea/todo-list.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/todo-list.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 103cfe12fe4ffe70ec750f18e2df5894272bd9bf Mon Sep 17 00:00:00 2001 From: Odysseus-Abraham Kirikopoulos Date: Sun, 20 Nov 2022 09:39:44 +0200 Subject: [PATCH 03/10] Commit --- .idea/.gitignore | 8 -------- .idea/inspectionProfiles/profiles_settings.xml | 6 ------ .idea/misc.xml | 4 ---- .idea/modules.xml | 8 -------- .idea/todo-list.iml | 8 -------- .idea/vcs.xml | 6 ------ 6 files changed, 40 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/todo-list.iml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index dc9ea49..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 48f1900..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/todo-list.iml b/.idea/todo-list.iml deleted file mode 100644 index d0876a7..0000000 --- a/.idea/todo-list.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 4b1a08bc60c4a1f0459a803eb091b166acc15e99 Mon Sep 17 00:00:00 2001 From: Odysseus-Abraham Kirikopoulos Date: Sun, 20 Nov 2022 10:17:44 +0200 Subject: [PATCH 04/10] Added due dates --- main.py | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/main.py b/main.py index 1ab737f..9345cf5 100644 --- a/main.py +++ b/main.py @@ -1,17 +1,17 @@ """ 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 1 +Version: 1.7 Pre Build 2 """ -list_1 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], - "task5": ["", "", "", ""]} # Lists storing the tasks +list_1 = {"task1": ["", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""], + "task5": ["", "", "", "", ""]} # Lists storing the tasks list_1_name = "Not defined" # The list's name -list_2 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], - "task5": ["", "", "", ""]} +list_2 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""], + "task5": ["", "", "", "", ""]} list_2_name = "Not defined" -list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], "task4": ["", "", "", ""], - "task5": ["", "", "", ""]} +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) @@ -27,9 +27,9 @@ def refresh_pr_list(): # Refreshes the list of tasks global print_task_l2 global print_task_l3 - print_task_l1 = f"\nTask 1: {list_1['task1'][0]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" - print_task_l2 = f"\nTask 1: {list_2['task1'][0]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" - print_task_l3 = f"\nTask 1: {list_3['task1'][0]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" + print_task_l1 = f"\nTask 1: {list_1['task1'][0]} | Due to: {list_1['task1'][4]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]} | Due to: {list_1['task2'][4]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]} | Due to: {list_1['task3'][4]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]} | Due to: {list_1['task4'][4]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]} | Due to: {list_1['task5'][4]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" + print_task_l2 = f"\nTask 1: {list_2['task1'][0]} | Due to: {list_2['task1'][4]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]} | Due to: {list_2['task2'][4]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]} | Due to: {list_2['task3'][4]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]} | Due to: {list_2['task4'][4]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]} | Due to: {list_2['task5'][4]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" + print_task_l3 = f"\nTask 1: {list_3['task1'][0]} | Due to: {list_3['task1'][4]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]} | Due to: {list_3['task2'][4]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]} | Due to: {list_3['task3'][4]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]} | Due to: {list_3['task4'][4]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]} | Due to: {list_3['task5'][4]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" def list_select(): # Allows the user to select a list @@ -85,7 +85,7 @@ 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 1\n\n") # Prints the build version +print("Build Version: 1.7 Pre Build 2\n\n") # Prints the build version # Greet print("~~~ MY TO-DO LIST ~~~") @@ -137,26 +137,36 @@ def subtask_select(): list_chosen["task1"][0] = input("\nEnter your task: ") print("\nTask created successfully!") + list_chosen["task1"][4] = input("Enter a due date [DD/MM HH:MM]: ") + elif list_chosen["task2"][0] == "": list_chosen["task2"][0] = input("\nEnter your task: ") print("\nTask created successfully!") + list_chosen["task2"][4] = input("Enter a due date: ") + elif list_chosen["task3"][0] == "": list_chosen["task3"][0] = input("\nEnter your task: ") print("\nTask created successfully!") + list_chosen["task3"][4] = input("Enter a due date: ") + elif list_chosen["task4"][0] == "": list_chosen["task4"][0] = input("\nEnter your task: ") print("\nTask created successfully!") + list_chosen["task4"][4] = input("Enter a due date: ") + elif list_chosen["task5"][0] == "": list_chosen["task5"][0] = input("\nEnter your task: ") print("\nTask created successfully!") + list_chosen["task5"][4] = input("Enter a due date: ") + else: print("\nErr:MaxTasksReached") # In case there are 5 tasks, no more can be created From b909d5cd3e0f4357cc4759d3be51813cfc53c362 Mon Sep 17 00:00:00 2001 From: Odysseus-Abraham Kirikopoulos Date: Sun, 20 Nov 2022 10:17:57 +0200 Subject: [PATCH 05/10] Added instructions for due dates --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 42a4091..ad6ed47 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,7 @@ _Example:_ I want to check of my task that is 3rd on my list. When asked for it ## What value to insert when asked to select a subtask If you are asked to provide a subtask to complete an operation, you can select one by inserting the number of the subtask inside a task. -_Example:_ I want to check off my subtask that is 1st inside the task. When asked for it I type '1'. \ No newline at end of file +_Example:_ I want to check off my subtask that is 1st inside the task. When asked for it I type '1'. + +## Due date format +When asked to insert a due date, you can insert it in any format. We can't limit the format, because it would be too restrictive. \ No newline at end of file From 2365db08f30a18c80b6b779eeda1b02ce3da86ef Mon Sep 17 00:00:00 2001 From: Odysseus Abraham Kirikopoulos Date: Sat, 14 Jan 2023 11:16:05 +0200 Subject: [PATCH 06/10] Optimizations --- main.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/main.py b/main.py index 9345cf5..ea35644 100644 --- a/main.py +++ b/main.py @@ -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 @@ -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 ~~~") @@ -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") @@ -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": ["", "", "", ""], @@ -242,7 +241,7 @@ 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": ["", "", "", ""]} @@ -250,7 +249,7 @@ def subtask_select(): 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!") From c7b237eeafb5505e17c45a2138edc6000e44caab Mon Sep 17 00:00:00 2001 From: Odysseus Abraham Kirikopoulos Date: Sat, 4 Mar 2023 11:17:09 +0200 Subject: [PATCH 07/10] Added priority --- main.py | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/main.py b/main.py index ea35644..8344e5d 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ """ 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 3 +Version: 1.7 Pre Build 4 """ list_1 = {"task1": ["", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""], @@ -26,9 +26,9 @@ def refresh_pr_list(): # Refreshes the list of tasks global print_task_l2 global print_task_l3 - print_task_l1 = f"\nTask 1: {list_1['task1'][0]} | Due to: {list_1['task1'][4]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]} | Due to: {list_1['task2'][4]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]} | Due to: {list_1['task3'][4]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]} | Due to: {list_1['task4'][4]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]} | Due to: {list_1['task5'][4]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" - print_task_l2 = f"\nTask 1: {list_2['task1'][0]} | Due to: {list_2['task1'][4]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]} | Due to: {list_2['task2'][4]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]} | Due to: {list_2['task3'][4]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]} | Due to: {list_2['task4'][4]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]} | Due to: {list_2['task5'][4]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" - print_task_l3 = f"\nTask 1: {list_3['task1'][0]} | Due to: {list_3['task1'][4]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]} | Due to: {list_3['task2'][4]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]} | Due to: {list_3['task3'][4]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]} | Due to: {list_3['task4'][4]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]} | Due to: {list_3['task5'][4]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" + print_task_l1 = f"\nTask 1: {list_1['task1'][0]} | Priority: {list_1['task1'][4]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]} | Priority: {list_1['task2'][4]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]} | Priority: {list_1['task3'][4]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]} | Priority: {list_1['task4'][4]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]} | Priority: {list_1['task5'][4]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" + print_task_l2 = f"\nTask 1: {list_2['task1'][0]} | Priority: {list_2['task1'][4]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]} | Priority: {list_2['task2'][4]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]} | Priority: {list_2['task3'][4]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]} | Priority: {list_2['task4'][4]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]} | Priority: {list_2['task5'][4]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" + print_task_l3 = f"\nTask 1: {list_3['task1'][0]} | Priority: {list_3['task1'][4]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]} | Priority: {list_3['task2'][4]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]} | Priority: {list_3['task3'][4]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]} | Priority: {list_3['task4'][4]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]} | Priority: {list_3['task5'][4]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" def list_select(): # Allows the user to select a list @@ -84,7 +84,7 @@ def subtask_select(): # Startup 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 +print("Build Version: 1.7 Pre Build 4\n\n") # Prints the build version # Greet print("~~~ MY TO-DO LIST ~~~") @@ -93,7 +93,7 @@ def subtask_select(): while True: # Infinite loop operation_tree = input( - "\nSelect the type of operation:\n(1) Create\n(2) Delete/Check off\n(3) Rename\n(4) View\nTo exit press 0\n\n") # Asks the user to select an operation + "\nSelect the type of operation:\n(1) Create\n(2) Delete/Check off\n(3) Edit\n(4) View\nTo exit press 0\n\n") # Asks the user to select an operation if operation_tree == "0": # User exiting break @@ -134,37 +134,37 @@ def subtask_select(): if list_chosen["task1"][0] == "": # Checking a non-occupied task to create the new one list_chosen["task1"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + print("\nTask created successfully!\n") - list_chosen["task1"][4] = input("Enter a due date [DD/MM HH:MM]: ") + list_chosen["task1"][4] = input("Enter the priority of the task (1-3): ") elif list_chosen["task2"][0] == "": list_chosen["task2"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + print("\nTask created successfully!\n") - list_chosen["task2"][4] = input("Enter a due date: ") + list_chosen["task2"][4] = input("Enter the priority of the task (1-3): ") elif list_chosen["task3"][0] == "": list_chosen["task3"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + print("\nTask created successfully!\n") - list_chosen["task3"][4] = input("Enter a due date: ") + list_chosen["task3"][4] = input("Enter the priority of the task (1-3): ") elif list_chosen["task4"][0] == "": list_chosen["task4"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + print("\nTask created successfully!\n") - list_chosen["task4"][4] = input("Enter a due date: ") + list_chosen["task4"][4] = input("Enter the priority of the task (1-3): ") elif list_chosen["task5"][0] == "": list_chosen["task5"][0] = input("\nEnter your task: ") - print("\nTask created successfully!") + print("\nTask created successfully!\n") - list_chosen["task5"][4] = input("Enter a due date: ") + list_chosen["task5"][4] = input("Enter the priority of the task (1-3): ") else: @@ -273,7 +273,7 @@ def subtask_select(): if operation_tree == "3": # User editing a list or a task - operation = input("\n -> (1) Rename a list\n -> (2) Rename a task\n\n") + operation = input("\n -> (1) Rename a list\n -> (2) Rename a task\n -> (3) Edit a task's priority\n\n") # Rename a list if operation == "1": @@ -306,6 +306,17 @@ def subtask_select(): refresh_pr_list() + # Add priority to a task + if operation == "3": + + task_select() + + list_chosen[task_chosen][4] = input("Edit the priority of the task (1-3): ") # Adding priority to the task + + refresh_pr_list() + + print("\nEdited priority to the task successfully!") + if operation_tree == "4": # User viewing a list list_select() From fae2068afc419560b18ea372bb4fd9f6e73cb2c9 Mon Sep 17 00:00:00 2001 From: Odysseus Abraham Kirikopoulos Date: Sat, 4 Mar 2023 11:17:18 +0200 Subject: [PATCH 08/10] Edited README --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index ad6ed47..3f57482 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,4 @@ # To-do List -These are the files for the To-Do List Python project. - -# All previous versions -If you want to dig into the full history of the development of this project, have a look at this Google Drive link: https://drive.google.com/drive/folders/12MN-6MU4N4PL1VYUSjvtOsdRQPENXD4-?usp=sharing - # Bugs I usually fix bugs on my own but if you find one, post an issue and I will look into it. If you have the time, feel free to fix it as well! From 64686c5ecc26d06ccc4af3a743c066da07f23c6e Mon Sep 17 00:00:00 2001 From: Odysseus Abraham Kirikopoulos Date: Mon, 1 May 2023 21:32:17 +0300 Subject: [PATCH 09/10] Added due date feature --- main.py | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/main.py b/main.py index 8344e5d..f615125 100644 --- a/main.py +++ b/main.py @@ -1,17 +1,17 @@ """ 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 4 +Version: 1.7 Pre Build 5 """ -list_1 = {"task1": ["", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""], - "task5": ["", "", "", "", ""]} # Lists storing the tasks +list_1 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", "", ""], "task3": ["", "", "", "", "", ""], "task4": ["", "", "", "", "", ""], + "task5": ["", "", "", "", "", ""]} # Lists storing the tasks list_1_name = None # The list's name -list_2 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""], - "task5": ["", "", "", "", ""]} +list_2 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", "", ""], "task3": ["", "", "", "", "", ""], "task4": ["", "", "", "", "", ""], + "task5": ["", "", "", "", "", ""]} list_2_name = None -list_3 = {"task1": ["", "", "", "", ""], "task2": ["", "", "", "", ""], "task3": ["", "", "", "", ""], "task4": ["", "", "", "", ""], - "task5": ["", "", "", "", ""]} +list_3 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", "", ""], "task3": ["", "", "", "", "", ""], "task4": ["", "", "", "", "", ""], + "task5": ["", "", "", "", "", ""]} 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 @@ -26,9 +26,9 @@ def refresh_pr_list(): # Refreshes the list of tasks global print_task_l2 global print_task_l3 - print_task_l1 = f"\nTask 1: {list_1['task1'][0]} | Priority: {list_1['task1'][4]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]} | Priority: {list_1['task2'][4]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]} | Priority: {list_1['task3'][4]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]} | Priority: {list_1['task4'][4]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]} | Priority: {list_1['task5'][4]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" - print_task_l2 = f"\nTask 1: {list_2['task1'][0]} | Priority: {list_2['task1'][4]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]} | Priority: {list_2['task2'][4]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]} | Priority: {list_2['task3'][4]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]} | Priority: {list_2['task4'][4]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]} | Priority: {list_2['task5'][4]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" - print_task_l3 = f"\nTask 1: {list_3['task1'][0]} | Priority: {list_3['task1'][4]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]} | Priority: {list_3['task2'][4]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]} | Priority: {list_3['task3'][4]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]} | Priority: {list_3['task4'][4]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]} | Priority: {list_3['task5'][4]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" + print_task_l1 = f"\nTask 1: {list_1['task1'][0]} | Priority: {list_1['task1'][4]} | Due date: {list_1['task1'][5]}\n -> {list_1['task1'][1]}\n -> {list_1['task1'][2]}\n -> {list_1['task1'][3]}\nTask 2: {list_1['task2'][0]} | Priority: {list_1['task2'][4]} | Due date: {list_1['task2'][5]}\n -> {list_1['task2'][1]}\n -> {list_1['task2'][2]}\n -> {list_1['task2'][3]}\nTask 3: {list_1['task3'][0]} | Priority: {list_1['task3'][4]} | Due date: {list_1['task3'][5]}\n -> {list_1['task3'][1]}\n -> {list_1['task3'][2]}\n -> {list_1['task3'][3]}\nTask 4: {list_1['task4'][0]} | Priority: {list_1['task4'][4]} | Due date: {list_1['task4'][5]}\n -> {list_1['task4'][1]}\n -> {list_1['task4'][2]}\n -> {list_1['task4'][3]}\nTask 5: {list_1['task5'][0]} | Priority: {list_1['task5'][4]} | Due date: {list_1['task5'][5]}\n -> {list_1['task5'][1]}\n -> {list_1['task5'][2]}\n -> {list_1['task5'][3]}\n" + print_task_l2 = f"\nTask 1: {list_2['task1'][0]} | Priority: {list_2['task1'][4]} | Due date: {list_2['task1'][5]}\n -> {list_2['task1'][1]}\n -> {list_2['task1'][2]}\n -> {list_2['task1'][3]}\nTask 2: {list_2['task2'][0]} | Priority: {list_2['task2'][4]} | Due date: {list_2['task2'][5]}\n -> {list_2['task2'][1]}\n -> {list_2['task2'][2]}\n -> {list_2['task2'][3]}\nTask 3: {list_2['task3'][0]} | Priority: {list_2['task3'][4]} | Due date: {list_2['task3'][5]}\n -> {list_2['task3'][1]}\n -> {list_2['task3'][2]}\n -> {list_2['task3'][3]}\nTask 4: {list_2['task4'][0]} | Priority: {list_2['task4'][4]} | Due date: {list_2['task4'][5]}\n -> {list_2['task4'][1]}\n -> {list_2['task4'][2]}\n -> {list_2['task4'][3]}\nTask 5: {list_2['task5'][0]} | Priority: {list_2['task5'][4]} | Due date: {list_2['task5'][5]}\n -> {list_2['task5'][1]}\n -> {list_2['task5'][2]}\n -> {list_2['task5'][3]}\n" + print_task_l3 = f"\nTask 1: {list_3['task1'][0]} | Priority: {list_3['task1'][4]} | Due date: {list_3['task1'][5]}\n -> {list_3['task1'][1]}\n -> {list_3['task1'][2]}\n -> {list_3['task1'][3]}\nTask 2: {list_3['task2'][0]} | Priority: {list_3['task2'][4]} | Due date: {list_3['task2'][5]}\n -> {list_3['task2'][1]}\n -> {list_3['task2'][2]}\n -> {list_3['task2'][3]}\nTask 3: {list_3['task3'][0]} | Priority: {list_3['task3'][4]} | Due date: {list_3['task3'][5]}\n -> {list_3['task3'][1]}\n -> {list_3['task3'][2]}\n -> {list_3['task3'][3]}\nTask 4: {list_3['task4'][0]} | Priority: {list_3['task4'][4]} | Due date: {list_3['task4'][5]}\n -> {list_3['task4'][1]}\n -> {list_3['task4'][2]}\n -> {list_3['task4'][3]}\nTask 5: {list_3['task5'][0]} | Priority: {list_3['task5'][4]} | Due date: {list_3['task5'][5]}\n -> {list_3['task5'][1]}\n -> {list_3['task5'][2]}\n -> {list_3['task5'][3]}\n" def list_select(): # Allows the user to select a list @@ -137,6 +137,7 @@ def subtask_select(): print("\nTask created successfully!\n") list_chosen["task1"][4] = input("Enter the priority of the task (1-3): ") + list_chosen["task1"][5] = input("Enter the due date for the task (DD/MM/YYYY): ") elif list_chosen["task2"][0] == "": @@ -144,6 +145,7 @@ def subtask_select(): print("\nTask created successfully!\n") list_chosen["task2"][4] = input("Enter the priority of the task (1-3): ") + list_chosen["task2"][5] = input("Enter the due date for the task (DD/MM/YYYY): ") elif list_chosen["task3"][0] == "": @@ -151,6 +153,7 @@ def subtask_select(): print("\nTask created successfully!\n") list_chosen["task3"][4] = input("Enter the priority of the task (1-3): ") + list_chosen["task3"][5] = input("Enter the due date for the task (DD/MM/YYYY): ") elif list_chosen["task4"][0] == "": @@ -158,6 +161,7 @@ def subtask_select(): print("\nTask created successfully!\n") list_chosen["task4"][4] = input("Enter the priority of the task (1-3): ") + list_chosen["task4"][5] = input("Enter the due date for the task (DD/MM/YYYY): ") elif list_chosen["task5"][0] == "": @@ -165,6 +169,7 @@ def subtask_select(): print("\nTask created successfully!\n") list_chosen["task5"][4] = input("Enter the priority of the task (1-3): ") + list_chosen["task5"][5] = input("Enter the due date for the task (DD/MM/YYYY): ") else: @@ -233,9 +238,8 @@ def subtask_select(): 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": ["", "", "", ""], - "task4": ["", "", "", ""], - "task5": ["", "", "", ""]} # Setting the third list to a default one + list_3 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", "", ""], "task3": ["", "", "", "", "", ""], "task4": ["", "", "", "", "", ""], + "task5": ["", "", "", "", "", ""]} print("List deleted successfully!") elif list_chosen == list_2: @@ -243,15 +247,15 @@ def subtask_select(): list_2_name = list_3_name list_3_name = None list_2 = list_3 - list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], - "task4": ["", "", "", ""], "task5": ["", "", "", ""]} + list_3 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", "", ""], "task3": ["", "", "", "", "", ""], "task4": ["", "", "", "", "", ""], + "task5": ["", "", "", "", "", ""]} print("List deleted successfully!") elif list_chosen == list_3: list_3_name = None - list_3 = {"task1": ["", "", "", ""], "task2": ["", "", "", ""], "task3": ["", "", "", ""], - "task4": ["", "", "", ""], "task5": ["", "", "", ""]} + list_3 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", "", ""], "task3": ["", "", "", "", "", ""], "task4": ["", "", "", "", "", ""], + "task5": ["", "", "", "", "", ""]} print("List deleted successfully!") else: @@ -335,4 +339,4 @@ def subtask_select(): exit_key = input() # Exiting the program -# This program is protected by the GNU General Public License v3.0 | ODYSSEUS-ABRAHAM KIRIKOPOULOS | 2022 | SOME RIGHTS RESERVED +# This program is protected by the GNU General Public License v3.0 | ODYSSEUS-ABRAHAM KIRIKOPOULOS | SOME RIGHTS RESERVED From f255784abc53397399291bfc8efc41107d15d520 Mon Sep 17 00:00:00 2001 From: Odysseus Abraham Kirikopoulos Date: Sat, 6 May 2023 22:25:20 +0300 Subject: [PATCH 10/10] Finallized for stable --- main.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index f615125..61fa355 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ """ 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 5 +Version: 1.7 """ list_1 = {"task1": ["", "", "", "", "", ""], "task2": ["", "", "", "", "", ""], "task3": ["", "", "", "", "", ""], "task4": ["", "", "", "", "", ""], @@ -72,7 +72,8 @@ def task_select(): # Allows the user to select a task print("Err:ListNotFound") -def subtask_select(): +def subtask_select(): # Allows the user to select a subtask + global subtask_chosen task_select() @@ -84,7 +85,7 @@ def subtask_select(): # Startup 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 4\n\n") # Prints the build version +print("Build Version: 1.7\n\n") # Prints the build version # Greet print("~~~ MY TO-DO LIST ~~~") @@ -92,8 +93,7 @@ def subtask_select(): # Operations while True: # Infinite loop - operation_tree = input( - "\nSelect the type of operation:\n(1) Create\n(2) Delete/Check off\n(3) Edit\n(4) View\nTo exit press 0\n\n") # Asks the user to select an operation + operation_tree = input("\nSelect the type of operation:\n(1) Create\n(2) Delete/Check off\n(3) Edit\n(4) View\nTo exit press 0\n\n") # Asks the user to select an operation if operation_tree == "0": # User exiting break @@ -119,8 +119,7 @@ def subtask_select(): 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 != None): # In case there are 3 lists, no more can be created + elif (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") @@ -205,8 +204,7 @@ def subtask_select(): if operation_tree == "2": # User deleting/checking off a list or a (sub)task - operation = input( - "\n -> (1) Check off a task\n -> (2) Check off a subtask\n -> (3) Delete a list\n -> (4) Delete a task\n\n") + operation = input("\n -> (1) Check off a task\n -> (2) Check off a subtask\n -> (3) Delete a list\n -> (4) Delete a task\n\n") # Check off a task if operation == "1":