Skip to content

Commit 74830b7

Browse files
committed
2026-05-13 15:56 BRT - I renamed the "Food_Time" module to "Meal_Times" to better reflect its purpose.
I changed the module's root class "Run" to use the "Modules" module to define its module and classes dictionaries. I did this to make the code prettier and more organized, but in terms of functionality, not much has changed. The main change was being able to use the new "Classes.json" file to define the module's classes. Which is also more of a change for aesthetics and organization than for functionality. I still need to refactor the root class of the "Meal_Times" module. - I refactored and significantly improved the root class of the "Modules" module to implement a new way to obtain the classes and descriptions of the Python modules. I created a new method called "Define_Dictionaries". This method defines the new dictionary of class modes with the modes "Descriptions" and "Classes", both containing a module description key. Now the "Define_Module" method also defines the module's class mode. The "Descriptions" class mode obtains the classes, their descriptions, and the module descriptions from the "Descriptions.json" file. The "Classes" class mode obtains this data from the "Classes.json" file, which is a new and much more organized way to obtain the list of classes and their data. The "Define_Module" method retrieves the JSON dictionary from the class mode-specific file, defines the key used to obtain the module descriptions, retrieves the descriptions, and stores all of this in the module dictionary. The "Define_Classes" method has been updated to reflect the changes in the class dictionary and the addition of the new class modes. For the "Classes" class mode, the class dictionary format is already correct. But for the "Descriptions" class mode, there is a temporary compatibility layer to obtain the class data and convert it to the new format. This is for modules that still use the old "Descriptions.json" file. This layer will be removed as soon as I finish updating all modules to use the new "Classes.json" file. The method has also been modified to update the new "Classes.json" file in the modules that use it, to add the number and list of classes. The "Select_Class" method has been updated to reflect the changes made to the modules' class dictionary. It also defines the selected class in a more beautiful and organized way, and with more elegant code. - In the "Module_Selector" module, I added the functionality for modules to define whether the names of their custom arguments are hyphenated or not. The default is for the argument underscore to be changed to a space, previously it was changed to a hyphen. With the "Hyphenated" key being set to True, the underscores in the custom argument name are changed to hyphens. - I started programming the code mentioned in this change block at 12:59 on May 13, 2026, and stopped at 15:56 on the same day. I programmed it for 2 hours, 40 minutes, and 56 seconds (02:40:56), including breaks.
1 parent 5fd6b48 commit 74830b7

44 files changed

Lines changed: 543 additions & 290 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"en": "Time that you will be hungry",
2424
"pt": "Horário em que você terá fome"
2525
},
26-
"raw_times, en - pt": "Raw times - Tempos brutos",
2726
"hours": {
2827
"en": "hours",
2928
"pt": "horas"
@@ -40,20 +39,20 @@
4039
"en": "Play alarm sound when you are hungry",
4140
"pt": "Tocar som de alarme quando você estiver com fome"
4241
},
43-
"times_taken_from_the_times_file": {
44-
"en": "Times taken from the times file",
45-
"pt": "Horários retirados do arquivo de horários"
42+
"the_times_were_obtained_from_the_times_file": {
43+
"en": "The times were obtained from the times file",
44+
"pt": "Os horários foram obtidos do arquivo de horários"
4645
},
47-
"times_registered_into_the_times_file": {
48-
"en": "Times registered into the times file",
49-
"pt": "Horários registrados no arquivo de horários"
46+
"the_times_were_recorded_in_the_times_file": {
47+
"en": "The times were recorded in the times file",
48+
"pt": "Os horários foram registrados no arquivo de horários"
5049
},
51-
"set": {
52-
"en": "Defines the time a meal was eaten using the {module} module",
53-
"pt": "Define a hora em que uma refeição foi consumida usando o módulo {module}"
50+
"register_the_meal_times": {
51+
"en": "Registers your meal times using the \"{module}\" module",
52+
"pt": "Registra os horários das suas refeiçõe usando o módulo \"{module}\""
5453
},
55-
"check": {
56-
"en": "Shows the time a meal was eaten using the {module} module",
57-
"pt": "Mostra a hora em que uma refeição foi consumida usando o módulo {module}"
54+
"show_the_meal_times": {
55+
"en": "Shows your meal times using the \"{module}\" module",
56+
"pt": "Mostra os horários das suas refeições usando o módulo \"{module}\""
5857
}
5958
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"Will be hungry": 3
1111
},
1212
"Ate": {
13-
"Object": "2026-05-09 15:04:08-03:00",
13+
"Object": "2026-05-13 12:28:56-03:00",
1414
"Time": 0,
15-
"Time text": "15:04",
15+
"Time text": "12:28",
1616
"Unit": {
1717
"en": "hours",
1818
"pt": "horas"
@@ -23,9 +23,9 @@
2323
}
2424
},
2525
"Can drink water": {
26-
"Object": "2026-05-09 15:44:08-03:00",
26+
"Object": "2026-05-13 13:08:56-03:00",
2727
"Time": 40,
28-
"Time text": "15:44",
28+
"Time text": "13:08",
2929
"Unit": {
3030
"en": "minutes",
3131
"pt": "minutos"
@@ -36,9 +36,9 @@
3636
}
3737
},
3838
"Will be hungry": {
39-
"Object": "2026-05-09 18:04:08-03:00",
39+
"Object": "2026-05-13 15:28:56-03:00",
4040
"Time": 3,
41-
"Time text": "18:04",
41+
"Time text": "15:28",
4242
"Unit": {
4343
"en": "hours",
4444
"pt": "horas"

MS.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def Get_Modules(self):
372372
"Module": importlib.import_module(title),
373373
"Root class": "",
374374
"Folders": {
375-
"Texts": {
375+
"Files": {
376376
"root": self.folders["Python"]["Files"]["root"] + title + "/"
377377
}
378378
},
@@ -405,17 +405,17 @@ def Get_Modules(self):
405405
setattr(module["Root class"], "Modules", self.Modules)
406406

407407
# Define the "Texts.json" file of the module
408-
module["Folders"]["Texts"]["Texts"] = module["Folders"]["Texts"]["root"] + "Texts.json"
408+
module["Folders"]["Files"]["Texts"] = module["Folders"]["Files"]["root"] + "Texts.json"
409409

410-
# Add the alternate argument names from the module if they exist
410+
# Add the alternative argument names from the module if they exist
411411
if (
412-
hasattr(module["Module"], "alternate_arguments") == True and
413-
type(module["Module"].alternate_arguments) == list
412+
hasattr(module["Module"], "alternative_arguments") == True and
413+
type(module["Module"].alternative_arguments) == list
414414
):
415-
# Get the list of alternate arguments
416-
arguments = module["Module"].alternate_arguments
415+
# Get the list of alternative arguments
416+
arguments = module["Module"].alternative_arguments
417417

418-
# Add them to the arguments list
418+
# Add them to the list of arguments of the module
419419
for argument in arguments:
420420
module["List"].append(argument)
421421

@@ -452,7 +452,7 @@ def Get_Modules(self):
452452
}
453453

454454
# Read the "Texts.json" file of the module to get its texts
455-
module["Texts"] = self.JSON.To_Python(module["Folders"]["Texts"]["Texts"])
455+
module["Texts"] = self.JSON.To_Python(module["Folders"]["Files"]["Texts"])
456456

457457
# Define the text key
458458
text_key = key
@@ -726,8 +726,20 @@ def Run_Module(self, module):
726726

727727
# If there is an underline in the custom key
728728
if "_" in custom_key:
729-
# Replace it with a dash
730-
custom_key = custom_key.replace("_", "-")
729+
# Define the character to replace with as a space
730+
character = " "
731+
732+
# If the "Hyphenated" key is inside the argument dictionary
733+
# And it value is True
734+
if (
735+
"Hyphenated" in argument and
736+
argument["Hyphenated"] == True
737+
):
738+
# Change the character to be a hyphen
739+
character = "-"
740+
741+
# Replace it with the defined character
742+
custom_key = custom_key.replace("_", character)
731743

732744
# Define the "Custom key" key as the local custom key
733745
argument["Custom key"] = custom_key

Modules/Database/Database/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def Define_Folders_And_Files(self):
146146
# Folders dictionary
147147
self.folders = self.Folder.Contents(self.folders["Notepad"]["Data Networks"]["Database"]["root"], lower_key = True)["dictionary"]
148148

149-
# Define the current year folder for easier typing
149+
# Define the current year folder for faster typing
150150
self.folders["history"]["current_year"] = self.folders["history"][str(self.date["Units"]["Year"])]
151151

152152
def Define_Types(self):

Modules/Diary_Slim/Create_New_Diary_Slim/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def Show_Information(self):
125125
# Define the information text as the "Skipped Diary Slim day" text
126126
self.dictionary["Texts"]["Information"] = self.language_texts["skipped_diary_slim_day"]
127127

128-
# Define the "Date" and "Units" variables for easier typing
128+
# Define the "Date" and "Units" variables for faster typing
129129
date = self.dictionary["Dates"]["Now"]
130130
units = date["Timezone"]["DateTime"]["Units"]
131131

@@ -161,13 +161,13 @@ def Check_For_File_Existence(self):
161161
self.Check_For_Skipped_Diary_Slims()
162162

163163
def Check_For_Skipped_Diary_Slims(self):
164-
# Define the today variable for easier typing
164+
# Define the today variable for faster typing
165165
today_date = self.date
166166

167167
# Get the Diary Slim day for today
168168
self.dictionary["Dates"]["Today"] = self.Current_Diary_Slim(date = today_date, current_diary_slim = False)["Day"]
169169

170-
# Define the yesterday variable for easier typing
170+
# Define the yesterday variable for faster typing
171171
yesterday_date = self.Date.Now(self.date["Object"] - self.Date.Timedelta(days = 1))
172172

173173
# Get the Diary Slim day for yesterday
@@ -183,15 +183,15 @@ def Check_For_Skipped_Diary_Slims(self):
183183
self.dictionary["Yesterday"] not in diary_slims_list and
184184
self.date["Units"]["Month"] != 1
185185
):
186-
# Define the days list for easier typing
186+
# Define the days list for faster typing
187187
days_list = list(range(1, self.date["Units"]["Month days"] + 1))
188188

189189
# Create the empty "Skipped Diary Slims" dictionary
190190
self.dictionary["Skipped Diary Slims"] = {}
191191

192192
# Iterate through the days list
193193
for day in days_list:
194-
# Define the "Units" and "Date" for easier typing
194+
# Define the "Units" and "Date" for faster typing
195195
units = self.dictionary["Dates"]["Now"]["Timezone"]["DateTime"]["Units"]
196196

197197
date = self.Date.Now(self.Date.Date(year = int(units["Year"]), month = int(units["Month"]), day = day))
@@ -278,7 +278,7 @@ def Check_For_Skipped_Diary_Slims(self):
278278
self.states["Skipped Diary Slims"]["Checked"] = True
279279

280280
def Create_Diary_Slim_Header(self):
281-
# Define the units and texts variables for easier typing
281+
# Define the units and texts variables for faster typing
282282
units = self.dictionary["Dates"]["Now"]["Timezone"]["DateTime"]["Units"]
283283
texts = self.dictionary["Dates"]["Now"]["Timezone"]["DateTime"]["Texts"]
284284

@@ -340,7 +340,7 @@ def Match_Time_Pattern(self, type_text, time = "", first_space = True):
340340
# Format the format text with the "format" text
341341
type_text += format_text.format(self.Language.language_texts["format"])
342342

343-
# Define the helper text variable for easier typing
343+
# Define the helper text variable for faster typing
344344
format_text_helper = self.Language.language_texts["wrong_format_utilize_this_one"]
345345

346346
# Import the "Re" module
@@ -389,7 +389,7 @@ def Write_To_Files(self):
389389

390390
# Define the "Creation time" dictionary
391391

392-
# Define the day, units, and texts variables for easier typing
392+
# Define the day, units, and texts variables for faster typing
393393
day = deepcopy(self.templates["Day"])
394394

395395
units = self.dictionary["Dates"]["Now"]["Timezone"]["DateTime"]["Units"]
@@ -538,7 +538,7 @@ def Write_To_Files(self):
538538

539539
# If the Diary Slim file is empty
540540
if file_text == []:
541-
# Define the verbose and current Diary Slim variables for easier typing
541+
# Define the verbose and current Diary Slim variables for faster typing
542542
verbose = True
543543
current_diary_slim = True
544544

Modules/Diary_Slim/Diary_Slim/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def Define_Folders_And_Files(self):
298298
"External statistics"
299299
]
300300

301-
# Define the folder for easier typing
301+
# Define the folder for faster typing
302302
folder = self.diary_slim["Folders"]["Data"]
303303

304304
# Iterate through the names list
@@ -333,7 +333,7 @@ def Define_Folders_And_Files(self):
333333

334334
# ---------- #
335335

336-
# Define the folder for easier typing
336+
# Define the folder for faster typing
337337
folder = self.diary_slim["Folders"]["Data"]["Header"]
338338

339339
# Define the "Header" files
@@ -356,7 +356,7 @@ def Define_Folders_And_Files(self):
356356
"Texts"
357357
]
358358

359-
# Define the folder for easier typing
359+
# Define the folder for faster typing
360360
folder = self.diary_slim["Folders"]["Data"]["Texts"]
361361

362362
for name in names:
@@ -373,7 +373,7 @@ def Define_Folders_And_Files(self):
373373
"Statistics"
374374
]
375375

376-
# Define the folder for easier typing
376+
# Define the folder for faster typing
377377
folder = self.diary_slim["Folders"]["Data"]["External statistics"]
378378

379379
for name in names:
@@ -390,7 +390,7 @@ def Define_Folders_And_Files(self):
390390
"History"
391391
]
392392

393-
# Define the folder for easier typing
393+
# Define the folder for faster typing
394394
folder = self.diary_slim["Folders"]["Years"]
395395

396396
for name in names:
@@ -542,7 +542,7 @@ def Define_History(self):
542542

543543
self.File.Create(folders["Year"])
544544

545-
# Define the file variable for easier typing
545+
# Define the file variable for faster typing
546546
file = folders["Year"]
547547

548548
# If the file is not empty
@@ -740,13 +740,13 @@ def Define_Current_Year(self):
740740

741741
# ---------- #
742742

743-
# Define the "current_month" variable for easier typing
743+
# Define the "current_month" variable for faster typing
744744
self.current_month = self.diary_slim["Current year"]["Month"]
745745

746746
# Get the current Diary Slim file
747747
self.diary_slim["Current year"]["Current Diary Slim file"] = self.Current_Diary_Slim()["File"]
748748

749-
# Define the "current_year" variable for easier typing
749+
# Define the "current_year" variable for faster typing
750750
self.current_year = self.diary_slim["Current year"]
751751

752752
def Current_Diary_Slim(self, current_year = None, date = None, current_diary_slim = True):
@@ -765,7 +765,7 @@ def Current_Diary_Slim(self, current_year = None, date = None, current_diary_sli
765765
# Get the "Diary Slim" dictionary
766766
dictionary = self.Make_Diary_Slim_Dictionary(date, current_year)
767767

768-
# Define the months and values variables for easier typing
768+
# Define the months and values variables for faster typing
769769
months = self.diary_slim["Current year"]["Year"]["Months"]
770770
values = list(months.values())
771771

@@ -810,7 +810,7 @@ def Make_Diary_Slim_Dictionary(self, date, current_year = None):
810810

811811
# ---------- #
812812

813-
# Define the date variables for easier typing
813+
# Define the date variables for faster typing
814814
datetime = date["Timezone"]["DateTime"]
815815
units = datetime["Units"]
816816
texts = datetime["Texts"]
@@ -863,7 +863,7 @@ def Define_Diary_Slim_Texts(self):
863863
"Dictionary": {}
864864
}
865865

866-
# Define the "Texts.json" file variable for easier typing
866+
# Define the "Texts.json" file variable for faster typing
867867
file = self.diary_slim["Folders"]["Data"]["Texts"]["Texts"]
868868

869869
# If the "Texts.json" file is not empty

Modules/Diary_Slim/Write_On_Diary_Slim/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def Get_Additional_Information(self, dictionary, is_statistic = False):
301301

302302
# If the text response exists inside the answers dictionary
303303
if questions[key]["Response"]["Text"] in question["Answers"]:
304-
# Define the response variable for easier typing
304+
# Define the response variable for faster typing
305305
response = questions[key]["Response"]["Text"]
306306

307307
# Get the answer dictionary
@@ -542,7 +542,7 @@ def Multi_Selection(self):
542542
# Define the empty texts list
543543
texts = []
544544

545-
# Define the "finish selection" variable for easier typing
545+
# Define the "finish selection" variable for faster typing
546546
finish_selection = "[Finish selection]"
547547

548548
# While the option is not the "[Finish selection]" text

Modules/Diary_Slim/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ def __init__(self):
55
# Run the root class of the "Modules" module
66
self.Modules(object = self, select_class = True)
77

8-
# Define the alternate arguments for the module
9-
alternate_arguments = [
8+
# Define the alternative arguments for the module
9+
alternative_arguments = [
1010
"slim"
1111
]
1212

13+
# If the script is being executed directly, run the local "Run" class
1314
if __name__ == "__main__":
1415
Run()

Modules/Food_Time/Play_Alarm/__init__.pyw

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)