Skip to content

Commit d94dc20

Browse files
committed
I greatly improved the "Update_Websites" sub-class of the "PHP" module.
I created a root dictionary containing all the data the sub-class will utilize. I have also greatly improved the sub-class documentation and comments, making them more descriptive and easier to understand. I also added three custom options. One to update all websites, one to update all story websites, and one to update all year websites. This way I can quickly update all story or year websites, without having to select one by one.
1 parent 65690e3 commit d94dc20

File tree

7 files changed

+465
-239
lines changed

7 files changed

+465
-239
lines changed

Module Files/Food_Time/Times.json

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

Module Files/PHP/Texts.json

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"general, title()": {
3-
"pt": "Geral",
4-
"en": "General"
5-
},
62
"websites": {
73
"pt": "sites",
84
"en": "websites"
@@ -31,10 +27,6 @@
3127
"pt": "Atualizando estes sites",
3228
"en": "Updating these websites"
3329
},
34-
"website_link": {
35-
"pt": "Link do site",
36-
"en": "Website link"
37-
},
3830
"press_enter_when_the_pages_finish_loading": {
3931
"pt": "Pressione Enter quando as páginas terminarem de carregar",
4032
"en": "Press Enter when the pages finish loading"
@@ -43,21 +35,21 @@
4335
"pt": "Atualizar mais sites",
4436
"en": "Update more websites"
4537
},
46-
"copy_and_paste_the_text": {
47-
"pt": "Copie e cole o texto",
48-
"en": "Copy and paste the text"
38+
"create_a_list_of_websites_to_update": {
39+
"pt": "Criar uma lista de sites para atualizar",
40+
"en": "Create a list of websites to update"
4941
},
50-
"create_website_list_to_update": {
51-
"pt": "Criar lista de sites para atualizar",
52-
"en": "Create website list to update"
42+
"update_all_websites": {
43+
"pt": "Atualizar todos os sites",
44+
"en": "Update all websites"
5345
},
54-
"finish_selection": {
55-
"pt": "Terminar seleção",
56-
"en": "Finish selection"
46+
"update_all_{}_websites": {
47+
"pt": "Atualizar todos os sites de {}",
48+
"en": "Update all {} websites"
5749
},
58-
"you_finished_updating_the_website": {
59-
"pt": "Você terminou de atualizar o site",
60-
"en": "You finished updating the website"
50+
"you_finished_updating_this_website": {
51+
"pt": "Você terminou de atualizar este site",
52+
"en": "You finished updating this website"
6153
},
6254
"you_finished_updating_these_websites": {
6355
"pt": "Você terminou de atualizar estes sites",

Module Files/Utility/Language/Texts.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,6 +2029,10 @@
20292029
"pt": "Sites",
20302030
"en": "Websites"
20312031
},
2032+
"year, title()": {
2033+
"pt": "Ano",
2034+
"en": "Year"
2035+
},
20322036
"years, title()": {
20332037
"pt": "Anos",
20342038
"en": "Years"
@@ -2073,6 +2077,10 @@
20732077
"en": "it is",
20742078
"pt": "é"
20752079
},
2080+
"in": {
2081+
"en": "in",
2082+
"pt": "em"
2083+
},
20762084
"on, style: in": {
20772085
"en": "on",
20782086
"pt": "no"

Modules/PHP/PHP/__init__.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ def __init__(self):
77

88
Define_Folders(self)
99

10+
# Module related methods
1011
self.Define_Basic_Variables()
11-
1212
self.Define_Texts()
1313

14+
# Define the dictionaries
15+
self.Define_Dictionaries()
16+
1417
def Define_Basic_Variables(self):
1518
from copy import deepcopy
1619

@@ -96,4 +99,14 @@ def Define_Texts(self):
9699
string += "-"
97100

98101
# Add the string to the Separators dictionary
99-
self.separators[str(number)] = string
102+
self.separators[str(number)] = string
103+
104+
def Define_Dictionaries(self):
105+
# Read the "Websites.json" file to get the "Websites" dictionary
106+
self.websites = self.JSON.To_Python(self.folders["Mega"]["PHP"]["JSON"]["Websites"])
107+
108+
# Read the "URL.json" file to get the "URL" dictionary
109+
self.url = self.JSON.To_Python(self.folders["Mega"]["PHP"]["JSON"]["URL"])
110+
111+
# Read the "Colors.json" file to get the "Colors" dictionary
112+
self.colors = self.JSON.To_Python(self.folders["Mega"]["PHP"]["JSON"]["Colors"])

Modules/PHP/Update_CSS_Colors/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def Define_Root_Dictionary(self):
2323
# With the selectors dictionary
2424
self.dictionary = {
2525
"Files": {
26-
"Colors JSON": self.folders["Mega"]["PHP"]["JSON"]["Colors"],
2726
"Colors CSS": self.folders["Mega"]["Websites"]["CSS"]["Colors"]
2827
},
2928
"Texts": {},
@@ -76,9 +75,6 @@ def Define_Root_Dictionary(self):
7675
}
7776
}
7877

79-
# Read the "Colors.json" file
80-
self.colors = self.JSON.To_Python(self.dictionary["Files"]["Colors JSON"])
81-
8278
def Create_Color_Selectors(self):
8379
# Iterate through the colors list
8480
for color_name in self.colors["List"]:

0 commit comments

Comments
 (0)