Skip to content

Commit a104c1d

Browse files
committedJan 4, 2025
In the "Diary_Slim" module, I added the new methods "Define_Statistics", "Update_Statistics", "Update_Current_Year_Statistics", and "Verify_Input".
The "Define_Statistics" method defines the general statistics dictionary and for each year. These statistics include things that I did during the year, like bike rides, driving, showers taken, times I washed my clothes, drawings, posted videos, work done, and family visits. It creates these dictionaries with the data and writes the general statistics dictionary to the "Statistics.json" file, which is located in the data folder of the Diary Slim. The method also defines a dictionary of years to store the folders and statistics dictionaries for each year. After that, it iterates through the text dictionary of Diary Slim to find texts that contain the key "Add to statistics". These texts have a list of custom statistics that will be added. Then, the "Define_Statistics" method calls the "Update_Statistics" method to update the general statistics file, for all years, and update the "Current year" dictionary of Diary Slim, which will be used later. The "Update_Current_Year_Statistics" method receives a modified statistics dictionary as a parameter, it updates the statistics file of the current year using that dictionary. The "Verify_Input" method verifies what the user types. It defines the input text to be shown to the user in their language. Furthermore, it checks if the requested input needs to be an integer. If so, it uses a regular expression to ensure that the input is indeed an integer. Finally, I updated the "Define_Additional_Information" method to make it more modular. This helps in defining statistics with responses of "Yes or no", "Type", and "Select". The statistics have a main key, which is the name of the statistic in English. For example, the Diary Slim text "Bike" corresponds to the key "Bike rides". They can include questions, like "How many times did you drive the car?", and the expected type of response, which can be "Yes or no", "Type", or "Select". Also, there is a dictionary of responses, in the case of "Yes or no", if the user answers "yes", it uses the "yes" dictionary that is inside the "Answers" dictionary. For instance, if the question is "Did you create new websites?", and the answer is yes, it says "Type how many websites you create". The statistics can also have additional questions, which are stored in a dictionary called "Questions". For example, in the case of in-person work, the main question is "What is the name of the workplace?", and an additional question is "How much money did you earn?". This way, the statistics can have multiple additional questions, each with its own statistic numbers. In the "Write_On_Diary_Slim" sub-class, I modified the "Define_Item_Variables" method to include the option for alternative text formatting. Normally, it is the root method "Define_Additional_Information" who formats the texts, in a simple way, just replacing the original text with a new formatted one. But I needed something more flexible, like the ability to select items from a list to format, as well as using texts with different genders, based on a list that contains them. For example, I have a text in Diary Slim that I use to register when my siblings come over to my house. So, I select which sibling visited, and the method checks the gender of that sibling, based on two lists: one with male names, and another with female names. Then, it formats the text that will be written in the Diary Slim, inserting the name of the sibling, and using "My brother" or "My sister", depending on the gender. In the same sub-class, I created a new method called "Manage_Statistic" (Gerenciar_Estatística). This method is executed when the Diary Slim text is also a statistic, and it retrieves the corresponding dictionary for that statistic. If the statistic has a question, the method calls "Define_Additional_Information" to ask the user for the necessary information. The responses can be "yes", followed by a question, "no", typing something, or selecting an option from a list. Next, the method defines a statistic text in the user's language, which will be shown later, considering some conditions that may change which text will be used. It also sets a key that will be used to locate the statistic in the current year's statistics dictionary. The method creates a statistics dictionary within the "Text" dictionary of the root dictionary, containing the number of statistics to be updated. Also, it includes the key "Dictionary", which contains a dictionary of the root statistic, with the text in the user's language, the old number, and the new number, which will still be changed. This dictionary also has the key "Changed statistic", which has a default value of "False". Then, the method sets the number to be added as one and checks if the statistic contains a question. If it does, it tries to get the answer from the information dictionary, if the answer is a digit, it converts it into a number. If the answer is "no" or zero, the number to be added is also set to zero. If the key "Questions" is present in the statistic dictionary, the method iterates through the list of questions, sets the old number, and adds the root number to the current year's statistic number. It also adds the additional statistics to the Diary Slim statistics dictionary, including the text, the old number, and the current number. After that, the method counts how many statistics need to be changed and increases the statistic number using the amount of the number to be added. If the old number and the new number are different, the method changes the state of "Changed statistic" to "True". Then, it checks if there is a text decorator in the Diary Slim text dictionary. If there is, it modifies the text that will be shown to the user, using the defined text decorator. For example, if the normal text is "[Name of the Person]" and the text decorator is "Visits of", the text with decorator would become "Visits of [Name of the Person]." This is a way to present the statistic text in a more appealing manner for the user. After that, the method updates the statistics for the current year, using the local statistics dictionary that has already been modified. The "Write" method checks if the Diary Slim text is a statistic and if it has been altered. If both conditions are true, it sets a text based on the number: "Changed statistic" for a single statistic and "Changed statistics" for two or more. Then, it displays this text along with the updated statistics. The text for each statistic appears in the user's language, including " in [Current year]", the current number of the statistic, and " (before: [old number])".
1 parent 81f2765 commit a104c1d

File tree

37 files changed

+2770
-861
lines changed

37 files changed

+2770
-861
lines changed
 

‎.megaignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-:*.sb-????????-??????
2+
-:*.tmp
3+
-:*~.*
4+
-:.git
5+
-:desktop.ini
6+
-:Thumbs.db
7+
-:~*

‎Module files/Christmas/Texts.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"pt": "Hoje não é dia de Natal, espere até",
44
"en": "Today is not Christmas day, wait until"
55
},
6-
"starting_{}_of_{}...": {
7-
"en": "Starting {} of {}...",
8-
"pt": "Iniciando {} de {}..."
6+
"starting_{}_day_in_{}": {
7+
"en": "Starting {} day in {}...",
8+
"pt": "Iniciando o dia de {} em {}..."
99
},
1010
"defining_the_christmas_theme": {
1111
"en": "Defining the Christmas theme",
@@ -27,12 +27,16 @@
2727
"pt": "Pressione Enter quando você terminar de passar um tempo com a Monika no jogo",
2828
"en": "Press Enter when you spending time with Monika on the game"
2929
},
30-
"press_enter_when_you_finish_adding_the_screenshots_to_the_scheduled_tweet": {
31-
"en": "Press Enter when you finish adding the screenshots of the decoreated computer to the scheduled tweet",
32-
"pt": "Pressione Enter quando você terminar de adicionar as prints do computador decorado ao tweet programado"
30+
"press_enter_when_you_finish_scheduling_the_tweets_of_the_screenshot_and_picture_of_the_decorated_computer": {
31+
"en": "Press Enter when you finish scheduling the tweets of the screenshot and picture of the decorated computer",
32+
"pt": "Pressione Enter quando você terminar de programar os tweets da print e foto do computador decorado"
3333
},
3434
"your_christmas_of_{}_is_finished_congratulations!": {
3535
"pt": "Seu Natal de {} está concluído, parabéns!",
3636
"en": "Your Christmas of {} is finished, congratulations!"
37+
},
38+
"do_you_want_to_skip_changing_the_profile_pictures": {
39+
"pt": "Você quer pular a mudança das fotos de perfil",
40+
"en": "Do you want to skip changing profile pictures"
3741
}
3842
}

‎Module files/Diary_Slim/Texts.json

+25-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
"en": "Select the drawing program",
6060
"pt": "Selecione o programa de desenho"
6161
},
62+
"select_the_sibling": {
63+
"en": "Select the sibling",
64+
"pt": "Selecione o irmão"
65+
},
6266
"type_how_much_course_classes_you_watched_(1_one)": {
6367
"en": "Type how much course classes you watched (1, one)",
6468
"pt": "Digite quantas aulas de curso você assistiu (1, uma)"
@@ -125,6 +129,26 @@
125129
},
126130
"this_diary_slim_was_written_on_the_phone": {
127131
"en": "This Slim Diary was written on the phone",
128-
"pt": "Este Diário Slim foi escrito no pelo celular"
132+
"pt": "Este Diário Slim foi escrito no celular"
133+
},
134+
"have_you_created_new_websites": {
135+
"en": "Have you created new websites",
136+
"pt": "Você criou novos sites"
137+
},
138+
"type_how_many_websites_have_you_created": {
139+
"en": "Type how many websites have you created",
140+
"pt": "Digite quantos sites você criou"
141+
},
142+
"type_the_name_of_the_workplace": {
143+
"en": "Type the name of the workplace",
144+
"pt": "Digite o nome do local de trabalho"
145+
},
146+
"type_how_much_money_you_earned": {
147+
"en": "Type how much money you earned",
148+
"pt": "Digite quanto dinheiro você ganhou"
149+
},
150+
"type_how_many_times_you_drove_the_car": {
151+
"en": "Type how many times you drove the car",
152+
"pt": "Digite quantas vezes você dirigiu o carro"
129153
}
130154
}

‎Module files/Food_Time/Times.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"Will be hungry": 3
1111
},
1212
"Ate": {
13-
"Object": "2024-09-17 23:27:01-03:00",
13+
"Object": "2025-01-04 02:17:59-03:00",
1414
"Time": 0,
15-
"Time text": "23:27",
15+
"Time text": "02:17",
1616
"Unit": {
1717
"en": "hours",
1818
"pt": "horas"
@@ -23,9 +23,9 @@
2323
}
2424
},
2525
"Can drink water": {
26-
"Object": "2024-09-18 00:07:01-03:00",
26+
"Object": "2025-01-04 02:57:59-03:00",
2727
"Time": 40,
28-
"Time text": "00:07",
28+
"Time text": "02:57",
2929
"Unit": {
3030
"en": "minutes",
3131
"pt": "minutos"
@@ -36,9 +36,9 @@
3636
}
3737
},
3838
"Will be hungry": {
39-
"Object": "2024-09-18 02:27:01-03:00",
39+
"Object": "2025-01-04 05:17:59-03:00",
4040
"Time": 3,
41-
"Time text": "02:27",
41+
"Time text": "05:17",
4242
"Unit": {
4343
"en": "hours",
4444
"pt": "horas"

‎Module files/GamePlayer/Texts.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124
"pt": "Postar nas Redes Sociais"
125125
},
126126
"i_posted_the_played_game_text, type: template": {
127-
"pt": "Postei o texto de jogo jogado e {} no meu servidor no {}, no status do {}, e no {}",
128-
"en": "I posted the text of the played game and {} on my server on {}, on the status of {}, and on {}"
127+
"pt": "Postei o texto do jogo jogado e {} no meu servidor no {}, no status do {}, e também no {}",
128+
"en": "I posted the text of the played game and {} on my server on {}, on the status of {}, and also on {}"
129129
},
130130
"press_enter_to_copy_the_text_of_the_played_game": {
131131
"en": "Press Enter to copy the text of the played game",
@@ -167,6 +167,10 @@
167167
"en": "Sub-game type",
168168
"pt": "Tipo de sub-jogo"
169169
},
170+
"sub_game_folder": {
171+
"en": "Sub-game folder",
172+
"pt": "Pasta de sub-jogo"
173+
},
170174
"dlc, upper()": {
171175
"en": "DLC",
172176
"pt": "DLC"

‎Module files/Stories/Texts.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,13 @@
261261
"en": "Do you want to update the chapter titles",
262262
"pt": "Você quer atualizar os títulos do capítulo"
263263
},
264-
"type_the_chapter_title_in_{}": {
265-
"en": "Type the chapter title in {}",
266-
"pt": "Digite o título do capítulo em {}"
264+
"old_title": {
265+
"en": "Old title",
266+
"pt": "Título antigo"
267+
},
268+
"type_the_new_chapter_title_in_{}": {
269+
"en": "Type the new chapter title in {}",
270+
"pt": "Digite o novo título do capítulo em {}"
267271
},
268272
"i_started_{}_the_chapter_{}_of_my_story_{}": {
269273
"en": "I started {} the chapter {} of my story \"{}\"",
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Testing": true,
3-
"Verbose": true,
2+
"Testing": false,
3+
"Verbose": false,
44
"User information": false,
55
"Has active switches": false
66
}

‎Module files/Utility/Language/Texts.json

+74-2
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@
556556
"pt": "Comprimento"
557557
},
558558
"example, title()": {
559-
"pt": "Exemplo",
560-
"en": "Example"
559+
"pt": "Exemplo",
560+
"en": "Example"
561561
},
562562
"{}_time": {
563563
"en": "{} time",
@@ -721,6 +721,10 @@
721721
"en": "and in",
722722
"pt": "e em"
723723
},
724+
"and_others, feminine": {
725+
"en": "and others",
726+
"pt": "e outras"
727+
},
724728
"or": {
725729
"en": "or",
726730
"pt": "ou"
@@ -2141,6 +2145,74 @@
21412145
"en": "Copying the Discord status",
21422146
"pt": "Copiando o status do Discord"
21432147
},
2148+
"my, type: both genders": {
2149+
"en": "My",
2150+
"pt": "Meu/Minha"
2151+
},
2152+
"siblings, title()": {
2153+
"en": "Siblings",
2154+
"pt": "Irmãos"
2155+
},
2156+
"sibling, type: both genders": {
2157+
"en": "sibling",
2158+
"pt": "irmão/irmã"
2159+
},
2160+
"my_brother": {
2161+
"en": "My brother",
2162+
"pt": "Meu irmão"
2163+
},
2164+
"my_sister": {
2165+
"en": "My sister",
2166+
"pt": "Minha irmã"
2167+
},
2168+
"updated_statistic": {
2169+
"en": "Updated statistic",
2170+
"pt": "Estatística atualizada"
2171+
},
2172+
"updated_statistics": {
2173+
"en": "Updated statistics",
2174+
"pt": "Estatísticas atualizadas"
2175+
},
2176+
"bike_rides": {
2177+
"en": "Bike rides",
2178+
"pt": "Passeios de bicicleta"
2179+
},
2180+
"times_i_drove_the_car": {
2181+
"en": "Times I drove the car",
2182+
"pt": "Vezes que dirigi o carro"
2183+
},
2184+
"showers_taken": {
2185+
"en": "Showers taken",
2186+
"pt": "Banhos tomados"
2187+
},
2188+
"times_i_washed_my_clothes": {
2189+
"en": "Times I washed my clothes",
2190+
"pt": "Vezes que lavei minhas roupa"
2191+
},
2192+
"drawings_made": {
2193+
"en": "Drawings made",
2194+
"pt": "Desenhos feitos"
2195+
},
2196+
"new_websites": {
2197+
"en": "New websites",
2198+
"pt": "Novos sites"
2199+
},
2200+
"videos_posted": {
2201+
"en": "Videos posted",
2202+
"pt": "Vídeos postados"
2203+
},
2204+
"days_that_i_worked": {
2205+
"en": "Days that I worked",
2206+
"pt": "Dias que eu trabalheiDias que trabalhei"
2207+
},
2208+
"before, title()": {
2209+
"en": "Before",
2210+
"pt": "Antes"
2211+
},
2212+
"visits_of": {
2213+
"en": "Visits of",
2214+
"pt": "Visitas de"
2215+
},
21442216
"genders, type: dict": {
21452217
"en": {
21462218
"masculine": {

‎Module files/Watch_History/Texts.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
"en": "Seasons",
6868
"pt": "Temporadas"
6969
},
70+
"last_season": {
71+
"en": "Last season",
72+
"pt": "Última temporada"
73+
},
7074
"comment_file_name": {
7175
"en": "Comment file name",
7276
"pt": "Nome de arquivo de comentário"
@@ -324,8 +328,8 @@
324328
"en": "I just finished watching {}"
325329
},
326330
"i_posted_the_watched_text, type: template": {
327-
"pt": "Postei o texto de assistido e {} no meu servidor no {}, no status do {}, e no {}",
328-
"en": "I posted the watched text and {} on my server on {}, on the status of {}, and on {}"
331+
"pt": "Postei o texto de assistido e {} no meu servidor no {}, no status do {}, e também no {}",
332+
"en": "I posted the watched text and {} on my server on {}, on the status of {}, and also on {}"
329333
},
330334
"press_enter_to_copy_the_watched_text": {
331335
"pt": "Pressione Enter para copiar o texto de assistido",

‎Module files/Years/Texts.json

+24
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@
3939
"pt": "Executando o criador de resumo de Ano",
4040
"en": "Executing the Year summary creator"
4141
},
42+
"summary_of_my_year_of_{current_year}": {
43+
"en": "Summary of my year of {current_year}",
44+
"pt": "Resumo do meu ano de {current_year}"
45+
},
46+
"summary_of_my_year_of_{current_year}, type: link": {
47+
"en": "summary-of-my-year-of-{current_year}",
48+
"pt": "resumo-do-meu-ano-de-{current_year}"
49+
},
50+
"summary_on": {
51+
"en": "Summary on",
52+
"pt": "Resumo no"
53+
},
54+
"post_the_year_summary_on_these_websites": {
55+
"en": "Post the year summary on these websites",
56+
"pt": "Poste o resumo do ano nestes sites"
57+
},
4258
"show_year_summary": {
4359
"en": "Show year summary",
4460
"pt": "Mostrar resumo do ano"
@@ -55,6 +71,10 @@
5571
"pt": "a soma dos números abaixo",
5672
"en": "the sum of numbers below"
5773
},
74+
"memories_of_the_year_in_images": {
75+
"pt": "Memórias do ano em imagens",
76+
"en": "Memories of the year in images"
77+
},
5878
"select_a_year_to_show_its_information": {
5979
"pt": "Selecione um Ano para mostrar suas informações",
6080
"en": "Select a Year to show its information"
@@ -78,5 +98,9 @@
7898
"{}_texts": {
7999
"pt": "Textos de \"{}\"",
80100
"en": "\"{}\" texts"
101+
},
102+
"goodbye_text_for_the_year": {
103+
"pt": "Texto de adeus para o ano",
104+
"en": "Goodbye text for the year"
81105
}
82106
}

0 commit comments

Comments
 (0)
Please sign in to comment.