Skip to content

Commit b7516fd

Browse files
committed
In the "Folder" class, I improved the creation of the folders on the folders dictionary, making it more dynamic with "for" loops, and also added the ability to create files using the "File" class.
In the "Tasks" class, I improved the definition of its folders, using the "Contents" method of the "Folder" class. I also created a new "Tasks.json" file and added more things to be written inside it. Like the number of total tasks, the list of task types, task names in English and Portuguese, and task descriptions in English and Portuguese. The "Tasks.json" file also exists inside all of the "Per Task Type" task type folders, but with only the task type dictionary. I improved the "Tasks" JSON dictionary a lot, adding "ISO8601" and language times, and this file name format: "Number. Task Type (Time)". I remade the "Register_Task" class to write on the new "Tasks.json" file and the same files on the tasks type folders. I also added a "Task list.txt" text file on the root folder and on each task type folder to contain the file names of the tasks. And a "Files" folder on each task type folder contains the task files, with a text containing all of the information about the task. I also created a new class called "Show_Tasks" to show all the information about the registered tasks. In the "Date" class, I improved the keys of the dictionary of the "Now" module, adding more date, time, and datetime formats. I also added day name, month name, date, and datetime formats in each language, as the "day_names", "month_names", "date_format", and "datetime_format" dictionaries.
1 parent 7203d2b commit b7516fd

File tree

23 files changed

+607
-361
lines changed

23 files changed

+607
-361
lines changed

MS.lnk

476 Bytes
Binary file not shown.

Module Files/Date/Texts.json

+8
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,13 @@
258258
"and": {
259259
"en": "and",
260260
"pt": "e"
261+
},
262+
"date_format": {
263+
"en": "%m/%d/%Y",
264+
"pt": "%d/%m/%Y"
265+
},
266+
"date_time_format": {
267+
"en": "%H:%M %m/%d/%Y",
268+
"pt": "%H:%M %d/%m/%Y"
261269
}
262270
}

Module Files/Food_Time/Times.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"pt": "Esta é a hora que você comeu",
2121
"en": "This is the time that you ate"
2222
},
23-
"date": "2023-01-03 03:46:24.086882",
24-
"time_string": "03:46"
23+
"date": "2023-01-04 15:35:55.453557",
24+
"time_string": "15:35"
2525
},
2626
"can_drink_water": {
2727
"time": 40,
@@ -34,8 +34,8 @@
3434
"pt": "Esta é a hora que você pode beber água",
3535
"en": "This is the time that you can drink water"
3636
},
37-
"date": "2023-01-03 04:26:24.086882",
38-
"time_string": "04:26"
37+
"date": "2023-01-04 16:15:55.453557",
38+
"time_string": "16:15"
3939
},
4040
"will_be_hungry": {
4141
"time": 3,
@@ -48,7 +48,7 @@
4848
"pt": "Esta é a hora que você irá ter fome",
4949
"en": "This is the time that you will be hungry"
5050
},
51-
"date": "2023-01-03 06:46:24.086882",
52-
"time_string": "06:46"
51+
"date": "2023-01-04 18:35:55.453557",
52+
"time_string": "18:35"
5353
}
5454
}

Module Files/Tasks/Texts.json

+16
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,24 @@
6363
"en": "Describe the task in",
6464
"pt": "Descreva a tarefa em"
6565
},
66+
"[language]_title": {
67+
"en": "English title",
68+
"pt": "Título em Português"
69+
},
70+
"task_description": {
71+
"en": "Task description",
72+
"pt": "Descrição da tarefa"
73+
},
74+
"task_descriptions": {
75+
"en": "Task descriptions",
76+
"pt": "Descrições da tarefa"
77+
},
6678
"task_description_in": {
6779
"en": "Task description in",
6880
"pt": "Descrição da tarefa em"
81+
},
82+
"task_text_template": {
83+
"en": "Number: {}\nTask type number: {}\nType: {}\nTime: {}\nFile name: {}",
84+
"pt": "Número: {}\nNúmero de tipo de tarefa: {}\nTipo: {}\nTempo: {}\nNome de arquivo: {}"
6985
}
7086
}

Modules/Block_Websites/Unblock/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from Block_Websites.Block import Block as Block
55

66
class Unblock(Block_Websites):
7-
def __init__(self, options = None, time = None, first_space = True, second_space = False):
7+
def __init__(self, options = None, time = None, first_space = True, second_space = True):
88
super().__init__()
99

1010
self.options = options
@@ -18,6 +18,9 @@ def __init__(self, options = None, time = None, first_space = True, second_space
1818
if type(self.website_to_unlock) == dict:
1919
self.website_to_unlock = [self.website_to_unlock["Website"]]
2020

21+
if self.options == None:
22+
second_space = False
23+
2124
self.time = time
2225

2326
if self.time == None:

Modules/Christmas/Christmas/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def Define_Files(self):
117117

118118
self.things_to_watch_file = self.current_year["folders"][self.language_texts["christmas, title(), en - pt"]]["root"] + self.language_texts["watch, title(), en - pt"] + ".txt"
119119

120-
self.watch_list_file = self.notepad_folders["networks"]["audiovisual_media_network"] + "Watch List.txt"
120+
self.watch_list_file = self.notepad_folders["networks"]["audiovisual_media_network"]["root"] + "Watch List.txt"
121121

122122
self.things_to_eat_file = self.current_year["folders"][self.full_user_language][self.language_texts["christmas, title()"]]["root"] + self.language_texts["eat, title()"] + ".txt"
123123

Modules/Code/Update_Websites/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def Define_Variables(self):
8484
]
8585

8686
self.websites = {
87-
"list": self.Language.JSON_To_Python(self.mega_folders["php"]["website"])["list"],
87+
"list": self.Language.JSON_To_Python(self.mega_folders["php"]["json"]["websites"]),
8888
"update": {},
8989
}
9090

Modules/Date/__init__.py

+32-4
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,56 @@ def Now(self, date_parameter = None):
9494
if date_parameter != None:
9595
date["date"] = date_parameter
9696

97+
# Day
9798
date["day"] = date["date"].day
9899
date["weekday"] = date["date"].weekday()
99100
date["day_name"] = self.language_texts["day_names, type: list"][date["weekday"]]
100101

102+
date["day_names"] = {}
103+
104+
for language in self.small_languages:
105+
date["day_names"][language] = self.texts["day_names, type: list"][language][date["weekday"]]
106+
107+
# Month
101108
date["month"] = date["date"].month
102109
date["month_name"] = self.language_texts["month_names, type: list"][date["month"]]
103110

111+
date["month_names"] = {}
112+
113+
for language in self.small_languages:
114+
date["month_names"][language] = self.texts["month_names, type: list"][language][date["month"]]
115+
116+
# Year
104117
date["year"] = date["date"].year
105118

119+
# Time
106120
date["time"] = date["date"].time()
107121
date["hour"] = date["date"].hour
108122
date["minute"] = date["date"].minute
109123
date["second"] = date["date"].second
110124

111-
date["strftime"] = date["date"].strftime("%H:%M %d/%m/%Y")
112-
date["%H:%M"] = date["date"].strftime("%H:%M")
125+
# Date formats
113126
date["%d/%m/%Y"] = date["date"].strftime("%d/%m/%Y")
114127
date["%d-%m-%Y"] = date["date"].strftime("%d-%m-%Y")
115-
date["%H:%M %d/%m/%Y"] = date["strftime"]
128+
129+
date["date_format"] = {}
130+
131+
for language in self.small_languages:
132+
date["date_format"][language] = date["date"].strftime(self.texts["date_format"][language])
133+
134+
# Time formats
135+
date["%H:%M"] = date["date"].strftime("%H:%M")
136+
137+
# Date time formats
138+
date["date_time_format"] = {}
139+
140+
for language in self.small_languages:
141+
date["date_time_format"][language] = date["date"].strftime(self.texts["date_time_format"][language])
116142

117143
date["ISO8601"] = date["date"].strftime("%Y-%m-%dT%H:%M:%S")
118-
date["%Y-%m-%dT%H:%M:%s"] = date["ISO8601"]
144+
date["%Y-%m-%dT%H:%M:%S"] = date["ISO8601"]
145+
date["%Y-%m-%d %H:%M:%S"] = date["date"].strftime("%Y-%m-%d %H:%M:%S")
146+
date["%H:%M %d/%m/%Y"] = date["date"].strftime("%H:%M %d/%m/%Y")
119147

120148
return date
121149

Modules/Diary_Slim/Write_On_Diary_Slim/__init__.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ def Define_Text_Variables(self):
155155
self.Type_Task_Descriptions()
156156

157157
def Type_Task_Descriptions(self):
158-
# Define task dictionary with names, descriptions, type, time, and files
158+
# Define task dictionary with titles, descriptions, type, time, and files
159159
self.task_dictionary = {
160-
"names": {},
160+
"titles": {},
161161
"descriptions": {},
162162
"type": self.text["key"],
163-
"time": self.Date.Now()["%H:%M %d/%m/%Y"],
163+
"time": self.Date.Now(),
164164
"files": {},
165165
}
166166

@@ -205,9 +205,9 @@ def Type_Task_Descriptions(self):
205205

206206
# Define task descriptions and make a backup of them
207207
for language in self.small_languages:
208-
self.task_dictionary["names"][language] = self.text["texts"][language] + "."
208+
self.task_dictionary["titles"][language] = self.text["texts"][language] + "."
209209

210-
self.task_dictionary["descriptions"][language] = self.task_dictionary["names"][language] + "\n\n"
210+
self.task_dictionary["descriptions"][language] = self.task_dictionary["titles"][language] + "\n\n"
211211
self.task_dictionary["descriptions"][language] += self.File.Contents(self.task_dictionary["files"][language])["string"]
212212

213213
text = self.task_dictionary["descriptions"][language]
@@ -230,6 +230,8 @@ def Write(self):
230230
Register_Task(self.task_dictionary)
231231

232232
if self.global_switches["verbose"] == True:
233+
self.task_dictionary["time"] = str(self.task_dictionary["time"])
234+
233235
print(self.Language.Python_To_JSON(self.task_dictionary))
234236

235237
self.File.Delete(self.backup_file)

0 commit comments

Comments
 (0)