-
Notifications
You must be signed in to change notification settings - Fork 48
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
Support for multiple "from"-fields with the same value. #12
Conversation
The release of Factorio 0.14.0 added two update possibilities for 0.13.18: 0.13.18 to 0.13.19 and 0.13.18 to 0.14.0. This commit supports that change by respecting the experimental flag earlier. Due to those changes, some declarations are moved to the top of the function and some comments have been added.
updates = [] | ||
# Get available updates | ||
for row in updater_json[factorio_package]: | ||
if not experimental and 'from' in row and row['from'] >= current_version and row['to'] <= latest[0]: |
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.
Ok, it's been a fair while since I wrote this originally, but I'm pretty sure comparing versions as strings doesn't work correctly ("0.13.2" compares as > "0.13.10"); this is why the version_key
function (stolen from elsewhere, IIRC) exists and breaks the string into a list of ints (which does compare as expected).
Otherwise, I believe this does as expected, so fix the version comparison and I'll go ahead and merge it.
Thanks for the assist, I really appreciate it. |
Thanks for the hint, you where right. An update from 0.13.5 would not have worked with my code. I used the mentioned function and now it seems to be working for all versions (i have tested 0.12.13, 0.13.0, 0.13.5, 0.13.15, 0.13.18 to stable and experimental). The only thing that is not working is to update from 0.13.19 (the latest stable) to experimental, but that's the "fault" of the Factorio developers, as there is no update package for 0.13.19 to experimental because 0.13.19 got released after the new experimental branch. I deleted the updates.append line somehow, that's also fixed now. |
Seems like i also removed the return value latest[1] by accident, which is used later to show the latest experimental version. I've added some lines to get that value. |
Looks good to me, let me get this merged. |
The release of Factorio 0.14.0 added two update possibilities for 0.13.18: 0.13.18 to 0.13.19 and 0.13.18 to 0.14.0. This commit supports that change by respecting the experimental flag earlier. Due to those changes, some declarations are moved to the top of the function and some comments have been added.