-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated item_filter in config.json.example to use item names instead item id's #1733
Changes from all commits
f50c3a6
db580a4
cc80470
9575182
eb49f46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,6 +441,13 @@ def init_config(): | |
parser.error("--catch_randomize_spin_factor is out of range! (should be 0 <= catch_randomize_spin_factor <= 1)") | ||
return None | ||
|
||
# item list config verification | ||
item_list = json.load(open(os.path.join('data', 'items.json'))) | ||
for config_item_name, bag_count in config.item_filter.iteritems(): | ||
if config_item_name not in item_list.viewvalues(): | ||
parser.error('item "' + config_item_name + '" does not exist, spelling mistake? (check for valid item names in data/items.json)') | ||
return None | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay it has the check very early on before server connection (for fast feedback) hence the reason for the json.load There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed conflicts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great. This should probably use
instead of raising though. |
||
# create web dir if not exists | ||
try: | ||
os.makedirs(web_dir) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should raise an exception if there is something in this list that isn't a known item. Otherwise people will have a typo here. Raising that exception will save us having to answer lots of support issues.