Skip to content
Snippets Groups Projects
Commit e2e04b9b authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added explanation on parallel lists.

parent 7c9ab810
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,13 @@ ...@@ -83,6 +83,13 @@
Whether the key is a valid key depends on the dict user that interprets Whether the key is a valid key depends on the dict user that interprets
the dictionary. the dictionary.
The information about the <fileName> ini files is kept in parallel lists.
First all filePaths to the fileName ini files are found within the rooDir
tree and kept in two parallel lists of filePaths and filePathsNames. Then
the ini files are read and kept in a parallel list of dicts. Iherefore it
is important that the indexing of parallel lists remains intact at all
times.
It can be useful to be able to refer to the dicts based on a certain key It can be useful to be able to refer to the dicts based on a certain key
value, e.g. a key value that gives the name of the dict. The methods value, e.g. a key value that gives the name of the dict. The methods
get_key_values() and get_dicts() provide a means to easily link a dict get_key_values() and get_dicts() provide a means to easily link a dict
...@@ -122,7 +129,7 @@ class CommonDictFile: ...@@ -122,7 +129,7 @@ class CommonDictFile:
self.nof_dicts = len(self.dicts) # number of dictionaries = number of dictorary files self.nof_dicts = len(self.dicts) # number of dictionaries = number of dictorary files
def remove_dict_from_list(self, the_dict): def remove_dict_from_list(self, the_dict):
"""Remove the_dict from the internal list of dicts from the available dictionary files.""" """Remove the_dict from the internal list of dicts from the available dictionary files and from the parallel lists of filePaths and filePathNames."""
k = self.dicts.index(the_dict) k = self.dicts.index(the_dict)
self.filePaths.pop(k) self.filePaths.pop(k)
self.filePathNames.pop(k) self.filePathNames.pop(k)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment