-
Notifications
You must be signed in to change notification settings - Fork 819
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
Use json.dumps() for yaml2mml.py #2459
Conversation
…ython 3. Use json.dumps() and convert to bytes afterwards for python 2 & 3 compatibility.
from #2279:
-> will investigate. |
Has been refined and now been tested with Linux and Windows. Python 2&3 on Linux and Windows are producing same output (with LF newline). Only exception is redirecting output of --check parameter to file, but this is not what this switch is for. |
amenity-points.mss and symbols/wilderness_hut.svg are ready for revision. I have now changed the file naming of wilderness_hut.svg (with icon produced by @nebulon42) following @nebulon42's convention in gravitystorm#2451. This commit also would like to help @jojo4u in testing his last update at gravitystorm#2459. I generated project.mml with Windows; I temporarily added the new yaml2mml.py, just to allow testing. Due to the inclusion of the new project.mml and new yaml2mml.py with this commit, please, do not merge by now.
amenity-points.mss and symbols/wilderness_hut.svg are ready for revision. I have now changed the file naming of wilderness_hut.svg (with icon produced by @nebulon42) following @nebulon42's convention in gravitystorm#2451. This commit also would like to help @jojo4u in testing his last update at gravitystorm#2459. I generated project.mml with Windows; I temporarily added the new yaml2mml.py, just to allow testing. Due to the inclusion of the new project.mml and new yaml2mml.py with this commit, please, do not merge by now. ______________________________________________________________________ **Rendering of tag tourism=wilderness_hut** Latest changes: - Use wilderness-hut.svg icon by @nebulon42 - Rebased to master ______________________________________________________________________ To summarize, the following different kind of huts have specific symbols now: - amenity=shelter (only shown at zoom >=16) - tourism=alpine_hut (not modified within this drop) - tourism=wilderness_hut (zoom>=13) Symbols: - wilderness_hut: symbols/wilderness_hut.svg (new) - alpine_hut: symbols/alpinehut.p.16.png (unmodified) - generic shelter: symbols/shelter.svg (unmodified)
@jojo4u: it looks working with Windows (tested travis and tilemill) |
Obsolete by #2473. Thanks nevertheless! |
Fixes #2447. Direct binary mode file output using json.dump() does not work with python 3. Other tricks like newline parameter for open() or using io.open() where not successful. Best solution is to use json.dumps() and convert to bytes afterwards for python 2 & 3 compatibility.
Yields the same sha256sum for python2 and python3. The parameter sort_keys=True has been introduced because python3 output had different sorting after every execution.
Not yet tested on Windows.