ptrv / gpx2spatialite

GNU General Public License v3.0
23 stars 8 forks source link

One script for all commands #23

Closed ptrv closed 9 years ago

ptrv commented 9 years ago

Remove explicit scipts and use only setuptools to define console_scripts entrypoints. Add helper commands create_db, update_locs and citydefs as subcommands in main script. Use argparse package instead of deprecated optparse package.

ptrv commented 9 years ago

@belasco @johnjohndoe

This is the first step to fix https://github.com/ptrv/gpx2spatialite/issues/22

I removed all scripts from the bin folder because with setuptools when you install the package a gpx2spatalite script will be generated automatically. Check out the changes in setup.py regarding entry_points. Without installing there is no runnable script there, so if you want to run without installing then change directory to the root folder of this project and run

python -m gpx2spatialite.gpx2spatialite

There are now subcommands for the helper scripts. To run them just add the subcommand name right after the script name, i.e. gpx2spatialite create_db. You can look up the help for all possible subcommands.

ptrv commented 9 years ago

I had to add also a subcommand for the main gpx2spatialite functionality, which i named import.

Old:

gpx2spatialite -d <path/to/database.db> -u <user> path/to/gpx_file.gpx

New:

gpx2spatialite import -d <path/to/database.db> -u <user> path/to/gpx_file.gpx