Skip to content

Commit 81f2765

Browse files
committed
In the "Stories" module, I greatly improved the code of the "Write" sub-class.
I created a new method called "Check_Chapter_Date_Texts", which will be executed by the "Define_Chapter" and "Finish_Writing" methods. It serves to verify and update the chapter date texts that I put at the beginning of all the chapters of my stories. These texts contain the date that the chapter was written, and last revised and translated. This method adds these texts to the chapter files when they do not exist. And also updates them as I write, revise, and translate the chapters. Now that addition of chapter dates to the files is no longer manual, but automatic. This way, there is no chance that I will forget to update the revision and translation dates, as I did before.
1 parent df91334 commit 81f2765

File tree

14 files changed

+267
-91
lines changed

14 files changed

+267
-91
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Module Files/Utility/API/client_secrets.json
2020
Module Files/Utility/API/Secrets.json
2121
Module Files/Utility/API/Token.json
2222

23+
# Template ignores
24+
2325
# rar and zip
2426
*.rar
2527
*.zip

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-08-23 16:17:57-03:00",
13+
"Object": "2024-09-17 23:27:01-03:00",
1414
"Time": 0,
15-
"Time text": "16:17",
15+
"Time text": "23:27",
1616
"Unit": {
1717
"en": "hours",
1818
"pt": "horas"
@@ -23,9 +23,9 @@
2323
}
2424
},
2525
"Can drink water": {
26-
"Object": "2024-08-23 16:57:57-03:00",
26+
"Object": "2024-09-18 00:07:01-03:00",
2727
"Time": 40,
28-
"Time text": "16:57",
28+
"Time text": "00:07",
2929
"Unit": {
3030
"en": "minutes",
3131
"pt": "minutos"
@@ -36,9 +36,9 @@
3636
}
3737
},
3838
"Will be hungry": {
39-
"Object": "2024-08-23 19:17:57-03:00",
39+
"Object": "2024-09-18 02:27:01-03:00",
4040
"Time": 3,
41-
"Time text": "19:17",
41+
"Time text": "02:27",
4242
"Unit": {
4343
"en": "hours",
4444
"pt": "horas"

Module files/GamePlayer/Texts.json

+2-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 tweet no {}",
128-
"en": "I posted the text of the played game and {} on my server on {}, on the status of {}, and tweet on {}"
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 {}"
129129
},
130130
"press_enter_to_copy_the_text_of_the_played_game": {
131131
"en": "Press Enter to copy the text of the played game",

Module files/Stories/Texts.json

+18
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,24 @@
429429
"en": "{} the chapter {} of my story {}",
430430
"pt": "{} o capítulo {} da minha história {}"
431431
},
432+
"dates_of_the_chapter": {
433+
"en": "Dates of the chapter",
434+
"pt": "Datas do capítulo"
435+
},
436+
"chapter_dates, type: dictionary": {
437+
"write": {
438+
"en": "This chapter was originally written on {}, at {}",
439+
"pt": "Este capítulo foi originalmente escrito em {}, às {}"
440+
},
441+
"revise": {
442+
"en": "It was last revised on {}, at {}",
443+
"pt": "Ele foi revisado pela última vez em {}, às {}"
444+
},
445+
"translate": {
446+
"en": "And it was translated into {} on {}, at {}",
447+
"pt": "E foi traduzido para o {} em {}, às {}"
448+
}
449+
},
432450
"do_you_want_to_add_more_authors": {
433451
"en": "Do you want to add more authors",
434452
"pt": "Você quer adicionar mais autores"

Module files/Utility/Date/Texts.json

+12-8
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,6 @@
328328
"en": "Seconds",
329329
"pt": "Segundos"
330330
},
331-
"date_format": {
332-
"en": "%m/%d/%Y",
333-
"pt": "%d/%m/%Y"
334-
},
335-
"date_time_format": {
336-
"en": "%H:%M %m/%d/%Y",
337-
"pt": "%H:%M %d/%m/%Y"
338-
},
339331
"time, title()": {
340332
"en": "Time",
341333
"pt": "Tempo"
@@ -428,6 +420,14 @@
428420
"en": "{} time",
429421
"pt": "Tempo de {}"
430422
},
423+
"date_format": {
424+
"en": "%m/%d/%Y",
425+
"pt": "%d/%m/%Y"
426+
},
427+
"date_time_format": {
428+
"en": "%H:%M %m/%d/%Y",
429+
"pt": "%H:%M %d/%m/%Y"
430+
},
431431
"{} {} {}": {
432432
"pt": "{} de {} de {}",
433433
"en": "{} {}, {}"
@@ -440,6 +440,10 @@
440440
"pt": "Hoje é dia {} de {} de {}, {}",
441441
"en": "Today is day {} {} {}, {}"
442442
},
443+
"date_format, type: format": {
444+
"pt": "[day] de [month name] de [year]",
445+
"en": "[month name] [day], [year]"
446+
},
443447
"date_and_time_texts, type: dict": {
444448
"short_time": "t",
445449
"long_time": "T",
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Testing": false,
3-
"Verbose": false,
2+
"Testing": true,
3+
"Verbose": true,
44
"User information": false,
55
"Has active switches": false
66
}

Module files/Watch_History/Texts.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@
324324
"en": "I just finished watching {}"
325325
},
326326
"i_posted_the_watched_text, type: template": {
327-
"pt": "Postei o texto de assistido e {} no meu servidor no {}, no status do {}, e tweet no {}",
328-
"en": "I posted the watched text and {} on my server on {}, on the status of {}, and tweet on {}"
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 {}"
329329
},
330330
"press_enter_to_copy_the_watched_text": {
331331
"pt": "Pressione Enter para copiar o texto de assistido",

Modules/Friends/Friends/__init__.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def Define_Information_Items(self):
408408
dictionary["Dictionary"][key]["Gender"]["Text"] = gender
409409

410410
# Update the gender "Words" dictionary inside the root information item dictionary
411-
dictionary["Dictionary"][key]["Gender"]["Words"] = dict_
411+
dictionary["Dictionary"][key]["Gender"]["Words"] = words
412412

413413
# Define the "Information items" dictionary as the local "Information items" dictionary
414414
self.information_items = dictionary
@@ -492,6 +492,18 @@ def Define_Friends_Dictionary(self):
492492
# Get the list of social networks
493493
self.friends["List"] = self.JSON.To_Python(self.folders["Friends"]["Text"]["Friends"])["List"]
494494

495+
# Iterate through the copy of the list of friends
496+
for friend in self.friends["List"].copy():
497+
# Get the friend folder
498+
friend_folder = self.folders["Friends"]["Text"]["root"] + friend + "/"
499+
500+
# If the folder does not exist
501+
if self.Folder.Exist(friend_folder) == False:
502+
# Remove the friend from the list of friends
503+
self.friends["List"].remove(friend)
504+
505+
# ---------- #
506+
495507
# Write the friends list to the "Friends list.txt" file
496508
text_to_write = self.Text.From_List(self.friends["List"], next_line = True)
497509

Modules/GamePlayer/GamePlayer/__init__.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -2172,10 +2172,4 @@ def Show_Information(self, dictionary):
21722172

21732173
# Show the description lines
21742174
for line in description:
2175-
print("\t" + line)
2176-
2177-
# If the user finished playing, ask for input before ending execution
2178-
print()
2179-
print(self.separators["5"])
2180-
2181-
self.Input.Type(self.Language.language_texts["press_enter_when_you_finish_reading_the_info_summary"])
2175+
print("\t" + line)

Modules/GamePlayer/Register/__init__.py

+14-17
Original file line numberDiff line numberDiff line change
@@ -727,22 +727,20 @@ def Post_On_Social_Networks(self):
727727
"Discord",
728728
"WhatsApp",
729729
"Instagram",
730-
"Facebook",
731-
"Twitter"
730+
"Facebook"
732731
],
733732
"List text": ""
734733
}
735734

736735
# Define the list text, with all the Social Networks separated by commas
737736
self.social_networks["List text"] = self.Text.From_List(self.social_networks["List"])
738737

739-
# Remove the "Discord" and "Twitter" Social Networks
738+
# Remove the "Discord" social networks
740739
self.social_networks["List"].remove("Discord")
741-
self.social_networks["List"].remove("Twitter")
742740

743741
# Define the list text, with all the Social Networks separated by commas
744-
# But without Twitter
745-
self.social_networks["List text (without Discord and Twitter)"] = self.Text.From_List(self.social_networks["List"])
742+
# But without Discord
743+
self.social_networks["List text (without Discord)"] = self.Text.From_List(self.social_networks["List"])
746744

747745
# Define the item text to be used
748746
self.social_networks["Item text"] = self.language_texts["the_game_cover"]
@@ -754,8 +752,8 @@ def Post_On_Social_Networks(self):
754752
self.social_networks["Items"] = [
755753
self.social_networks["Item text"],
756754
"Discord",
757-
self.social_networks["List text (without Discord and Twitter)"],
758-
"Twitter"
755+
self.social_networks["List text (without Discord)"],
756+
"Bluesky " + self.Language.language_texts["and"] + " Threads"
759757
]
760758

761759
# Format the template with the items list
@@ -767,16 +765,18 @@ def Post_On_Social_Networks(self):
767765
print()
768766
print(self.separators["5"])
769767

768+
# Ask if the user wants to post the played session status on the social networks
770769
self.dictionary["Entry"]["States"]["Post on the Social Networks"] = self.Input.Yes_Or_No(text)
771770

771+
# If yes
772772
if self.dictionary["Entry"]["States"]["Post on the Social Networks"] == True:
773+
# Import the "Open_Social_Network" sub-class of the "Social_Networks" module
773774
from Social_Networks.Open_Social_Network import Open_Social_Network as Open_Social_Network
774775

775-
# Define the Social Networks dictionary
776+
# Define the "Social Networks" dictionary
776777
social_networks = {
777778
"List": [
778779
"WhatsApp",
779-
"Twitter",
780780
"Facebook",
781781
"Discord"
782782
],
@@ -785,15 +785,12 @@ def Post_On_Social_Networks(self):
785785
}
786786
}
787787

788-
# Open the Social Networks, one by one
789-
Open_Social_Network(social_networks)
790-
791-
self.Input.Type(self.language_texts["press_enter_to_copy_the_text_of_the_played_game"])
792-
793-
self.Text.Copy(self.dictionary["Entry"]["Dates"]["Timezone"] + ":\n" + self.dictionary["Entry"]["Diary Slim"]["Clean text"])
788+
# Open the social networks, one by one
789+
#Open_Social_Network(social_networks)
794790

791+
# Show a separator
795792
print()
796-
print("-----")
793+
print(self.separators["5"])
797794
print()
798795

799796
def Write_On_Diary_Slim(self):

0 commit comments

Comments
 (0)