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
4e349d3d
Commit
4e349d3d
authored
Mar 07, 2019
by
Nicolas MAILLET
Browse files
Force order of dict of exception to avoid random of dict
parent
6ef47271
Changes
1
Hide whitespace changes
Inline
Side-by-side
rpg/rule.py
View file @
4e349d3d
...
...
@@ -672,7 +672,7 @@ def find_missing_rule(main_rule, dict_of_rule, depth=0):
# Dict of missing rules. Key is depth.
ret
=
defaultdict
(
list
)
# For each rule of the exception
for
i
in
dict_of_rule
:
for
i
in
reversed
(
sorted
(
dict_of_rule
))
:
# Backup the dict
dict_of_rule_small
=
dict_of_rule
.
copy
()
# Remove current rule
...
...
@@ -751,7 +751,7 @@ def find_rechable_pos(main_rule, dict_of_rule):
ret
[
len
(
dict_of_rule
)]
=
main_rule
else
:
# For each rules
for
i
in
dict_of_rule
:
for
i
in
reversed
(
sorted
(
dict_of_rule
))
:
# Create the corresponding rule
tmp_rule
=
Rule
(
i
,
dict_of_rule
[
i
],
False
,
-
1
)
# Get the corresponding rule in main_rule
...
...
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