Skip to content

Conversation

@dhewg
Copy link

@dhewg dhewg commented Jun 5, 2025

This PR…

...is just a bunch of smaller things I noticed while starting with this nice tool.
The commits are small and easy to review (I hope).

Some of it is mostly internal stuff, the nice user-facing change is that -tag_wahoo_xml now accepts random filenames, and not just relative ones to the internal resources directory.
Similar, there's now --tags_to_keep and --tag_transform with the exact same logic.

As most major themes will touch all three of the mentioned files, it's now possible to have multiple themes, each with their own configuration files, next to each other and build them without messing around in the pip install or user config directories.

Caveats

I didn't touch the unittests nor the gui.
The former will have to be adapted if these changes are accepted.
The latter should still work, but could be extended to handle the new command line switches.

Pull Request Checklist

@dhewg dhewg force-pushed the app branch 2 times, most recently from 9467c2d to b0ad963 Compare June 5, 2025 19:18
@dhewg
Copy link
Author

dhewg commented Jun 5, 2025

The old pylint version didn't work on my end, so I updated that. With that, every commit now passes the pylint checks.
Most unittest pass now, some do not (like that @mock thing, but that didn't work before either here), but I'd leave it at that...

dhewg added 17 commits June 6, 2025 07:35
Remove the now redundant controls, found with:
pylint --enable=useless-suppression
is_required_input_given_or_exit() already checks that either country or
x/y is set, make pylint happy with a simple "else".

Fixes:
wahoomc/main.py:76:8: E0606: Possibly using variable 'o_osm_data' before assignment (possibly-used-before-assignment)
This makes it work everywhere, no matter if it's `python` or `python3`.
This actually happened, in which case everything falls apart.
Visible when using --verbose.
Pass on which tool to use, osmfilter or osmium.

This makes it easier to switch to the other tool, as all are available
on all platforms.
It wasn't used consistently anyway.
No need for "else" if an error case sys.exit()s.
Don't just look in the user config directory and the bundled resources/ folder,
allow passing any filename to --tag_wahoo_xml.

Order of preference:
- filesystem, either relative or absolute
- relative to the user config directory
- relative to the bundled resources directory
Use the same logic as with --tag_wahoo_xml
And test that instead. There's no need to adapt the test everytime the
file gets changed.
The functionality is already tested with real files, there's no need to
bend over backwards and hack around with mock, which doesn't work in its
current state anyway.
Use the same logic as with --tag_wahoo_xml
This enables wildcard values like %f and %s.

The current ones in tag-wahoo-poi.xml were ignored unit now, so remove
them to keep the results unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant