Skip to content

Commit 5080ded

Browse files
committed
In the "System" utility module, I created two new methods, "Create_Shortcut" and "Get_Shortcut".
"Create_Shortcut" creates a shortcut file based on the file or link that is passed to it. And then it creates and returns the shortcut's dictionary, with its file name, folder, file, extension, and destination file or link. "Get_Shortcut" receives the path to a shortcut file and creates its dictionary, with the data mentioned above.
1 parent c8eaae5 commit 5080ded

File tree

62 files changed

+1784
-286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1784
-286
lines changed

MS.py

+18-6
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ def __init__(self):
2323
# Define the parser
2424
self.Define_Parser()
2525

26+
# Reset the switches
27+
self.Reset_Switches()
28+
2629
# Get the modules
2730
self.Get_Modules()
2831

2932
# Check the arguments and switches
3033
self.Check_Arguments_And_Switches()
3134

32-
# Reset the switches
33-
self.Reset_Switches()
34-
3535
# If the class does not has arguments
3636
if self.has_arguments == False:
3737
# Ask the user to select a module from the list
@@ -81,7 +81,7 @@ def Import_Classes(self):
8181
# Define the "Language" class as the same class inside the "JSON" class
8282
self.Language = self.JSON.Language
8383

84-
# Define the local folders dictionary as the Folder folders dictionary
84+
# Define the local "folders" dictionary as the dictionary inside the "Folder" class
8585
self.folders = self.Folder.folders
8686

8787
def Define_Basic_Variables(self):
@@ -165,6 +165,17 @@ def Define_Parser(self):
165165
"Help": self.language_texts["stores_the_module_to_be_executed"]
166166
},
167167
"Language text": False
168+
},
169+
"update_modules": {
170+
"List": [
171+
"update_modules"
172+
],
173+
"Text key": "updates_the_json_file_of_the_modules",
174+
"Options": {
175+
"Action": "store_true",
176+
"Help": self.language_texts["updates_the_json_file_of_the_modules"]
177+
},
178+
"Language text": False
168179
}
169180
},
170181
"Default options": {
@@ -540,12 +551,13 @@ def Check_Arguments(self):
540551
# If the arguments contain the lowercase version of the module
541552
# And the module argument is True
542553
# That means the user wrote the command as:
543-
# python MS.py -Module_Title
554+
# python MS.py -module_title
544555
#
545-
# Or if the arguments the "module" argument
556+
# Or if the arguments contain the "module" argument
546557
# And the argument value is inside the possible module title options
547558
# That means the user wrote the command as:
548559
# python MS.py -module Module_Title
560+
# Or any of the other options
549561
if (
550562
hasattr(self.arguments, module_lower) and
551563
getattr(self.arguments, module_lower) == True or

Module files/Diary_Slim/Texts.json

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@
111111
"en": "You skipped creating these Diary Slims",
112112
"pt": "Você pulou a criação destes Diários Slim"
113113
},
114+
"it_was_created_by_the_program": {
115+
"en": "It was created by the program",
116+
"pt": "Ele foi criado pelo programa"
117+
},
114118
"they_were_created_by_the_program": {
115119
"en": "They were created by the program",
116120
"pt": "Eles foram criados pelo programa"

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

Module files/Module_Selector/Texts.json

+4
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,9 @@
6666
"stores_the_module_to_be_executed": {
6767
"en": "Stores the module to be executed",
6868
"pt": "Guarda o módulo a ser executado"
69+
},
70+
"updates_the_json_file_of_the_modules": {
71+
"en": "Updates the JSON file of the modules",
72+
"pt": "Atualiza o arquivo JSON dos módulos"
6973
}
7074
}

Module files/Project_Zomboid/Texts.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"en": "Type the details of the survivor",
2020
"pt": "Digite os detalhes do sobrevivente"
2121
},
22-
"the_class_used_a_survivor": {
22+
"the_class_used_a_predefined_survivor": {
2323
"en": "The class used a predefined survivor",
2424
"pt": "A classe utilizou um sobrevivente pré-definido"
2525
},

Module files/Python/Code templates/Main class.txt

+32-24
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,50 @@
22

33
class [module_name](object):
44
def __init__(self):
5-
# Define the module folders
6-
from Utility.Define_Folders import Define_Folders as Define_Folders
5+
# Import the classes
6+
self.Import_Classes()
77

8-
Define_Folders(self)
8+
# Define the folders of the module
9+
self.folders = self.Define_Folders(object = self).folders
910

1011
# Module related methods
1112
self.Define_Basic_Variables()
1213
self.Define_Texts()
1314

14-
def Define_Basic_Variables(self):
15-
from copy import deepcopy
15+
def Import_Classes(self):
16+
# Define the list of modules to be imported
17+
modules = [
18+
"Define_Folders",
19+
"JSON"
20+
]
1621

17-
# Import the JSON module
18-
from Utility.JSON import JSON as JSON
22+
# Iterate through the list of modules
23+
for module_title in modules:
24+
# Import the module
25+
module = importlib.import_module("." + module_title, "Utility")
1926

20-
self.JSON = JSON()
27+
# Get the sub-class
28+
sub_class = getattr(module, module_title)
29+
30+
# If the module title is not "Define_Folders"
31+
if module_title != "Define_Folders":
32+
# Run the sub-class to define its variable
33+
sub_class = sub_class()
34+
35+
# Add the sub-class to the current module
36+
setattr(self, module_title, sub_class)
2137

2238
# Define the "Language" class as the same class inside the "JSON" class
2339
self.Language = self.JSON.Language
2440

41+
def Define_Basic_Variables(self):
2542
# Get the modules list
26-
self.modules = self.JSON.To_Python(self.folders["apps"]["modules"]["modules"])
43+
self.modules = self.JSON.To_Python(self.folders["Apps"]["Modules"]["Modules"])
2744

2845
# Create a list of the modules that will not be imported
2946
remove_list = [
3047
"Define_Folders",
48+
"Modules",
3149
"Language",
3250
"JSON"
3351
]
@@ -45,21 +63,6 @@ class [module_name](object):
4563
# Add the sub-class to the current module
4664
setattr(self, module_title, sub_class())
4765

48-
# Make a backup of the module folders
49-
self.module_folders = {}
50-
51-
for item in ["modules", "module_files"]:
52-
self.module_folders[item] = deepcopy(self.folders["apps"][item][self.module["key"]])
53-
54-
# Define the local folders dictionary as the Folder folders dictionary
55-
self.folders = self.Folder.folders
56-
57-
self.links = self.Folder.links
58-
59-
# Restore the backup of the module folders
60-
for item in ["modules", "module_files"]:
61-
self.folders["apps"][item][self.module["key"]] = self.module_folders[item]
62-
6366
# Get the switches dictionary from the "Global Switches" module
6467
self.switches = self.Global_Switches.switches["Global"]
6568

@@ -70,6 +73,11 @@ class [module_name](object):
7073
self.user_language = self.Language.user_language
7174
self.full_user_language = self.Language.full_user_language
7275

76+
# Define the local "folders" dictionary as the dictionary inside the "Folder" class
77+
self.folders = self.Folder.folders
78+
79+
# Import the "links" variable from the "Folder"
80+
7381
# Get the Sanitize method of the File class
7482
self.Sanitize = self.File.Sanitize
7583

Module files/Python/Code templates/Root.txt

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
class Run():
44
def __init__(self):
5-
# Import the "Modules" module
6-
from Utility.Modules import Modules as Modules
7-
8-
# Add it to the object of this class
9-
self.Modules = Modules
10-
11-
# Run its root class
5+
# Run the root class of the "Modules" module
126
self.Modules(object = self, select_class = True)
137

148
if __name__ == "__main__":

Module files/Stories/Texts.json

+8
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@
237237
"en": "the time subtracted from the total {} time",
238238
"pt": "o tempo subtraído do tempo total de {}"
239239
},
240+
"with_the_pause_time_subtracted": {
241+
"en": "with the paues time subtracted",
242+
"pt": "com o tempo de pausa subtraído"
243+
},
240244
"press_enter_when_you_stop": {
241245
"en": "Press Enter when you stop",
242246
"pt": "Pressione Enter quando você parar de"
@@ -413,6 +417,10 @@
413417
"en": "Select a writing status",
414418
"pt": "Selecione um status de escrita"
415419
},
420+
"{}_the_chapter_{}_of_my_story_{}": {
421+
"en": "{} the chapter {} of my story {}",
422+
"pt": "{} o capítulo {} da minha história {}"
423+
},
416424
"do_you_want_to_add_more_authors": {
417425
"en": "Do you want to add more authors",
418426
"pt": "Você quer adicionar mais autores"

Module files/Utility/Language/Texts.json

+12
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,10 @@
18181818
"en": "Story Covers",
18191819
"pt": "Capas de Histórias"
18201820
},
1821+
"in_progress": {
1822+
"en": "in progress",
1823+
"pt": "em andamento"
1824+
},
18211825
"reader, title()": {
18221826
"en": "Reader",
18231827
"pt": "Leitor"
@@ -1898,6 +1902,10 @@
18981902
"en": "Translate",
18991903
"pt": "Traduzir"
19001904
},
1905+
"google_translate": {
1906+
"en": "Google Translate",
1907+
"pt": "Google Tradutor"
1908+
},
19011909
"post, title()": {
19021910
"en": "Post",
19031911
"pt": "Postar"
@@ -2105,6 +2113,10 @@
21052113
"en": "posted",
21062114
"pt": "postado"
21072115
},
2116+
"copying_the_discord_status": {
2117+
"en": "Copying the Discord status",
2118+
"pt": "Copiando o status do Discord"
2119+
},
21082120
"genders, type: dict": {
21092121
"en": {
21102122
"masculine": {

Modules/Block_Websites/Block_Websites/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def Define_Basic_Variables(self):
8686
self.user_language = self.Language.user_language
8787
self.full_user_language = self.Language.full_user_language
8888

89-
# Define the local folders dictionary as the Folder folders dictionary
89+
# Define the local "folders" dictionary as the dictionary inside the "Folder" class
9090
self.folders = self.Folder.folders
9191

9292
# Get the Sanitize method of the File class

Modules/Block_Websites/Module.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"Module": "Block_Websites",
3+
"Folders": {
4+
"root": "C:/Apps/Modules/Block_Websites/",
5+
"Texts": {
6+
"root": "C:/Apps/Module files/Block_Websites/"
7+
}
8+
},
9+
"Files": {
10+
"Descriptions": "C:/Apps/Modules/Block_Websites/Descriptions.json",
11+
"Module": "C:/Apps/Modules/Block_Websites/Module.json"
12+
},
13+
"Descriptions": {
14+
"Show text": "Gerenciar o bloqueio de sites",
15+
"Block": {
16+
"en": "Block",
17+
"pt": "Bloquear"
18+
},
19+
"Unblock": {
20+
"en": "Unblock",
21+
"pt": "Desbloquear"
22+
}
23+
},
24+
"Classes": {
25+
"Dictionary": {
26+
"Block": {
27+
"Descriptions": {
28+
"en": "Block",
29+
"pt": "Bloquear"
30+
},
31+
"Description": "Bloquear",
32+
"Object": "<class 'Block_Websites.Block.Block'>"
33+
},
34+
"Unblock": {
35+
"Descriptions": {
36+
"en": "Unblock",
37+
"pt": "Desbloquear"
38+
},
39+
"Description": "Desbloquear",
40+
"Object": "<class 'Block_Websites.Unblock.Unblock'>"
41+
}
42+
},
43+
"Descriptions": [
44+
"Bloquear",
45+
"Desbloquear"
46+
]
47+
}
48+
}

Modules/Christmas/Christmas/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def Define_Basic_Variables(self):
9393
self.user_language = self.Language.user_language
9494
self.full_user_language = self.Language.full_user_language
9595

96-
# Define the local folders dictionary as the Folder folders dictionary
96+
# Define the local "folders" dictionary as the dictionary inside the "Folder" class
9797
self.folders = self.Folder.folders
9898

9999
# Get the Sanitize method of the File class

Modules/Christmas/Module.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"Module": "Christmas",
3+
"Folders": {
4+
"root": "C:/Apps/Modules/Christmas/",
5+
"Texts": {
6+
"root": "C:/Apps/Module files/Christmas/"
7+
}
8+
},
9+
"Files": {
10+
"Descriptions": "C:/Apps/Modules/Christmas/Descriptions.json",
11+
"Module": "C:/Apps/Modules/Christmas/Module.json"
12+
},
13+
"Descriptions": {
14+
"Show text": "Natal",
15+
"Start_Christmas": {
16+
"en": "Start Christmas",
17+
"pt": "Começar o Natal"
18+
}
19+
},
20+
"Classes": {
21+
"Dictionary": {
22+
"Start_Christmas": {
23+
"Descriptions": {
24+
"en": "Start Christmas",
25+
"pt": "Começar o Natal"
26+
},
27+
"Description": "Começar o Natal",
28+
"Object": "<class 'Christmas.Start_Christmas.Start_Christmas'>"
29+
}
30+
},
31+
"Descriptions": [
32+
"Começar o Natal"
33+
]
34+
}
35+
}

0 commit comments

Comments
 (0)