Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
e2e04b9b
Commit
e2e04b9b
authored
9 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added explanation on parallel lists.
parent
7c9ab810
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/oneclick/base/common_dict_file.py
+9
-2
9 additions, 2 deletions
tools/oneclick/base/common_dict_file.py
with
9 additions
and
2 deletions
tools/oneclick/base/common_dict_file.py
+
9
−
2
View file @
e2e04b9b
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment