Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nicolas MAILLET
rpg
Commits
8c60fe76
Commit
8c60fe76
authored
May 02, 2018
by
Nicolas MAILLET
Browse files
bugfix, protect name of a new enzyme to another one can't take the same
parent
f48e49bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
rpg/enzyme.py
View file @
8c60fe76
...
...
@@ -252,14 +252,16 @@ def user_creation_enzyme(all_enzymes):
.. warning:: It could be a problem to immediately use the new enzyme (see in-code warning)
"""
add_enzyme
=
"y"
# All enzymes name
all_name_enz
=
set
()
# Get all used names
for
enz
in
all_enzymes
:
all_name_enz
.
add
(
enz
.
name
)
# Adding enzyme
while
add_enzyme
==
"y"
:
# All enzymes name
all_name_enz
=
set
()
# Get all used names
for
enz
in
all_enzymes
:
all_name_enz
.
add
(
enz
.
name
)
# Name of the enzyme
name_new_enz
=
input
(
"Name of the new enzyme?
\n
"
)
...
...
@@ -317,5 +319,8 @@ def user_creation_enzyme(all_enzymes):
# Write in the user-defined enzymes file
new_enz
.
write_enzyme_in_user_file
()
# Add it to known names
all_name_enz
.
add
(
new_enz
.
name
)
# End of this new enzyme
add_enzyme
=
input
(
"Add an other enzyme? (y/n)
\n
"
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment