Skip to content

Commit 573243e

Browse files
committed
In the "Stories" module, I have made the following changes:
In its "Post" sub-class, I modified how the chapter is posted on the story websites and on the social networks. Before, the chapter was posted only on Wattpad, but now it is also posted on Spirit Fanfics, with the help of the "Story websites" dictionary. I renamed the "Post_On_Wattpad" method to "Post_On_Story_Websites". The method above now asks for the chapter link on each story website. Previously, it was the "Post_On_Social_Networks" method who did that, and asked only for the Wattpad link. On the "Post_On_Social_Networks" method, the chapter is now posted on the social networks Discord, WhatsApp, Instagram, Facebook, Twitter, and the two story websites. I greatly improved how chapter posting cards are created, and how thesocial networks are open. I created a new method called "Make_Post_Cards" to help create posting cards, without repeating its code through the sub-class. Now the creation and copying of posting cards are dynamic, being different for each social network. Having the first and second part of the card, removing or adding hashtags, and creating secondary cards, depending on the social network. I also added to the post task record dictionary a new key called "Custom task item". This custom item contains the type of action done in the chapter, such as posting, writing, revising, and translating. This item goes to the "Register" sub-class of the "Tasks" module. Thus changing the task state text "First task type task in year". The normal text is "First story chapter {} in year". The "Register" sub-class replaces the text "{}" in the text above with the custom task item. For example: "First story chapter [posted/written/revised/translated] in year".
1 parent 14c5334 commit 573243e

File tree

13 files changed

+566
-208
lines changed

13 files changed

+566
-208
lines changed

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

Module Files/Social_Networks/Texts.json

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
"pt": "Abrindo a Rede Social \"{}\" em sua página de {}, com este link",
4040
"en": "Opening the Social Network \"{}\" on its {} page, with this link"
4141
},
42+
"opening_the_social_network_{}_with_this_link": {
43+
"pt": "Abrindo a Rede Social \"{}\" com este link",
44+
"en": "Opening the Social Network \"{}\" with this link"
45+
},
4246
"please_type_the_social_network_profile_information": {
4347
"pt": "Por favor digite as informações do perfil da Rede Social",
4448
"en": "Please type the Social Network profile information"

Module Files/Stories/Texts.json

+37-21
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,21 @@
5959
"en": "Press Enter to copy the chapter text",
6060
"pt": "Pressione Enter para copiar o texto do capítulo"
6161
},
62-
"press_enter_when_you_finish_posting_the_card_on_{}": {
63-
"en": "Press Enter when you finish posting the card on {}",
64-
"pt": "Pressione Enter quando você terminar de postar o card no {}"
62+
"press_enter_when_you_finish_posting_the_card_on": {
63+
"en": "Press Enter when you finish posting the card on",
64+
"pt": "Pressione Enter quando você terminar de postar o card no"
6565
},
66-
"paste_the_first_part_of_the_card_of_{}_on_the_post_text_box": {
67-
"en": "Paste the first part of the card of {} on the post text box",
68-
"pt": "Cole a primeira parte do card do {} na caixa de texto da postagem"
66+
"press_enter_when_you_finish_posting_the_social_network_card_of": {
67+
"en": "Press Enter when you finish posting the social network card of",
68+
"pt": "Pressione Enter quando você terminar de postar o card de rede social do"
6969
},
70-
"paste_the_second_part_of_the_card_of_{}_on_the_post_text_box": {
71-
"en": "Paste the second part of the card of {} on the post text box",
72-
"pt": "Cole a segunda parte do card do {} na caixa de texto da postagem"
70+
"posting_the_general_card_on": {
71+
"en": "Posting the general card on",
72+
"pt": "Postar o card geral no"
73+
},
74+
"posting_the_social_network_card_of": {
75+
"en": "Posting the social network card of",
76+
"pt": "Postar o card de rede social do"
7377
},
7478
"copying_the_cover_to_the_{}_folder": {
7579
"en": "Copying the cover to the [{}] folder",
@@ -91,21 +95,21 @@
9195
"en": "website story covers",
9296
"pt": "capas de histórias do site"
9397
},
94-
"paste_the_wattpad_chapter_link": {
95-
"en": "Paste the Wattpad chapter link",
96-
"pt": "Cole o link do capítulo no Wattpad"
98+
"paste_the_link_of_the_chapter_on": {
99+
"en": "Paste the link of the chapter on",
100+
"pt": "Cole o link do capítulo no"
97101
},
98102
"one_more_chapter": {
99-
"en": "One more chapter",
100-
"pt": "Mais um capítulo"
103+
"en": "one more chapter",
104+
"pt": "mais um capítulo"
101105
},
102106
"the_first_chapter": {
103-
"en": "The first chapter",
104-
"pt": "O primeiro capítulo"
107+
"en": "the first chapter",
108+
"pt": "o primeiro capítulo"
105109
},
106110
"the_last_chapter": {
107-
"en": "The last chapter",
108-
"pt": "O último capítulo"
111+
"en": "the last chapter",
112+
"pt": "o último capítulo"
109113
},
110114
"type_the_information_of_the_story": {
111115
"en": "Type the information of the story",
@@ -175,6 +179,18 @@
175179
"Traduzi"
176180
]
177181
},
182+
"writing_modes_chapter, type: list": {
183+
"en": [
184+
"written",
185+
"revised",
186+
"translated"
187+
],
188+
"pt": [
189+
"escrito",
190+
"revisado",
191+
"traduzido"
192+
]
193+
},
178194
"writing_modes": {
179195
"en": "Writing modes",
180196
"pt": "Modos de escrita"
@@ -337,9 +353,9 @@
337353
"en": "You finished updating the chapter covers of this story",
338354
"pt": "Você terminou de atualizar as capas de capítulo desta história"
339355
},
340-
"i_published_the_chapter_number_{}_of_my_story_{}_on_the_story_website_and_on_wattpad_with_the_title": {
341-
"en": "I published the chapter number {} ({}) of my story \"{}\" on the story website and on Wattpad, with the title",
342-
"pt": "Eu publiquei o capítulo número {} ({}) da minha história \"{}\" no site da história e no Wattpad, com o título"
356+
"i_published_the_chapter_number_{}_of_my_story_{}_on_the_story_website": {
357+
"en": "I published the chapter number {} ({}) of my story \"{}\" on the story website",
358+
"pt": "Eu publiquei o capítulo número {} ({}) da minha história \"{}\" no site da história"
343359
},
344360
"you_finished_copying_the_chapter_titles_of_this_story": {
345361
"en": "You finished copying the chapter titles of this story",

Module Files/Utility/Language/Texts.json

+23-3
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,18 @@
171171
"en": "Leave empty to use the default value",
172172
"pt": "Deixe vazio para usar o valor padrão"
173173
},
174-
"press_enter_when_you": {
175-
"en": "Press Enter when you",
176-
"pt": "Pressione Enter quando você"
174+
"press_enter_when_you_finish": {
175+
"en": "Press Enter when you finish",
176+
"pt": "Pressione Enter quando você terminar de"
177177
},
178178
"press_enter_when_you_finish_reading_the_info_summary": {
179179
"en": "Press Enter when you finish reading the info summary",
180180
"pt": "Pressione Enter quando você terminar de ler o resumo de informações"
181181
},
182+
"press_enter_when_you": {
183+
"en": "Press Enter when you",
184+
"pt": "Pressione Enter quando você"
185+
},
182186
"multi_selection": {
183187
"en": "Multi-selection",
184188
"pt": "Seleção múltipla"
@@ -619,6 +623,10 @@
619623
"pt": "Títulos",
620624
"en": "Titles"
621625
},
626+
"with_the_title": {
627+
"pt": "com o título",
628+
"en": "with the title"
629+
},
622630
"id, upper()": {
623631
"en": "ID",
624632
"pt": "ID"
@@ -2041,6 +2049,18 @@
20412049
"en": "it is",
20422050
"pt": "é"
20432051
},
2052+
"on, style: in": {
2053+
"en": "on",
2054+
"pt": "no"
2055+
},
2056+
"and_on, style: in": {
2057+
"en": "and on",
2058+
"pt": "e no"
2059+
},
2060+
"posted": {
2061+
"en": "posted",
2062+
"pt": "postado"
2063+
},
20442064
"genders, type: dict": {
20452065
"en": {
20462066
"masculine": {

Modules/GamePlayer/Register/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ def Post_On_Social_Networks(self):
685685
"List": [
686686
"WhatsApp",
687687
"Twitter",
688+
"Facebook",
688689
"Discord"
689690
],
690691
"Custom links": {

Modules/Social_Networks/Open_Social_Network/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ def Show_Information(self):
179179
# Define the text template
180180
template = self.language_texts["opening_the_social_network_{}_on_its_{}_page_with_this_link"]
181181

182+
# If there are custom links in the dictionary
183+
if "Custom links" in self.dictionary["Social Networks"]:
184+
# Change the template text
185+
template = self.language_texts["opening_the_social_network_{}_with_this_link"]
186+
182187
# Define the text template items
183188
items = [
184189
self.social_network["Name"],

Modules/Social_Networks/Social_Networks/__init__.py

+33-16
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ def Define_Social_Networks_Dictionary(self):
216216
"Items",
217217
"Profile",
218218
"Settings",
219-
"Image folders"
219+
"Image folders",
220+
"Social Network"
220221
],
221222
"Dictionary": {}
222223
}
@@ -301,18 +302,6 @@ def Define_Social_Networks_Dictionary(self):
301302
# Get the list of social networks
302303
self.social_networks["List"] = self.JSON.To_Python(self.folders["Social Networks"]["Text"]["Social Networks"])["List"]
303304

304-
# Remove the non-friend folders from the above list
305-
to_remove = [
306-
"4chan",
307-
self.Language.language_texts["database, title()"],
308-
"Google+",
309-
"Plug DJ"
310-
]
311-
312-
for item in to_remove:
313-
if item in self.social_networks["List"]:
314-
self.social_networks["List"].remove(item)
315-
316305
# Write the Social Networks list to the "Social Networks list.txt" file
317306
text_to_write = self.Text.From_List(self.social_networks["List"], break_line = True)
318307

@@ -369,15 +358,15 @@ def Define_Social_Networks_Dictionary(self):
369358
# Define the file name language
370359
language = self.user_language
371360

372-
if key == "Items":
361+
if key in ["Items", "Social Network"]:
373362
language = "en"
374363

375364
file_name = file_name[language]
376365

377366
# Define the extension
378367
extension = "txt"
379368

380-
if key == "Items":
369+
if key in ["Items", "Social Network"]:
381370
extension = "json"
382371

383372
# Define the file
@@ -392,7 +381,11 @@ def Define_Social_Networks_Dictionary(self):
392381
dictionary["Settings"]["Create image folders"] == True
393382
):
394383
# If the item is "Text"
395-
if item == "Text":
384+
# Or the key is "Social Network"
385+
if (
386+
item == "Text" or
387+
key == "Social Network"
388+
):
396389
# Create the file
397390
self.File.Create(dict_[key])
398391

@@ -783,6 +776,30 @@ def Define_Information_Items(self):
783776
if social_network["Information"]["Link"] in additional_item:
784777
social_network["Profile"]["Links"][sub_key] = additional_item
785778

779+
# ---------- #
780+
781+
# Make a local copy of the "Social Network" dictionary
782+
local_dictionary = deepcopy(social_network)
783+
784+
# Define the root keys to remove
785+
to_remove = [
786+
"Folders",
787+
"Files",
788+
"Information items"
789+
]
790+
791+
# Iterate through the "root keys to remove" list and remove the keys
792+
for sub_key in to_remove:
793+
local_dictionary.pop(sub_key)
794+
795+
# Update the "Social Network.json" file with the updated and local "Social Network" dictionary
796+
self.JSON.Edit(social_network["Folders"]["Social Network"], local_dictionary)
797+
798+
# Update the image "Social Network.json" file with the updated and local "Social Network" dictionary
799+
self.JSON.Edit(social_network["Folders"]["Image"]["Social Network"], local_dictionary)
800+
801+
# ---------- #
802+
786803
# Update the root "Social Network" dictionary
787804
self.social_networks["Dictionary"][key] = social_network
788805

0 commit comments

Comments
 (0)