[pycsw-devel] revamped CLI for pycsw-admin.py

Ricardo Filipe Soares Garcia da ricardo.garcia.silva at gmail.com
Sat Apr 23 15:59:44 PDT 2016


+1 from me.

I had actually started doing something very similar to Tom's proposal last
year[1].
I never got around to finishing it because I got carried away and started
changing other things which didn't get finished ;)

What I had done:

* replaced optparse with argparse
* use argparse subparsers
* decided on which parameters were optional and which ones were mandatory

Something which was on my mind as well was investigating if/how this newer
implementation could be integrated into other tools, for example django's
django-admin.py.

If folks are positive towards this change, It might be worth it to salvage
my previous work and finish/improve it.


[1] -
https://github.com/ricardogsilva/pycsw/blob/refactor_admin/bin/pycsw-admin.py


On Sat, Apr 23, 2016 at 11:20 PM, Tom Kralidis <tomkralidis at gmail.com>
wrote:

> Hi all: given we are headed towards 2.0 it's a good time to think about
> serious changes that would valuable.
>
> One that has come to my mind is revamping the CLI for pycsw-admin.py
> to be more elegant, in particular:
>
> 1./ using subcommands
>
> Instead of:
>
> pycsw-admin.py -c post_xml -u http://localhost:8000 -x path/to/file.xml
>
> pycsw-admin.py post-xml http://localhost:8000 path/to/file.xml
>
> Figuring out what's a positional arg (beyond the first 'subcommand'
> are) and what's worth a flag will need investigation.
>
> 2./ moving pycsw-admin.py into into pycsw.core.admin within __main__
> and declaring pycsw-admin.py as an entry point in setup.py.  Looks
> like this requires a move (from distutils) to setuptools
>
> Thoughts?  What approaches
> or tools/libs can we use to move this forward?
> What do folks think about renewing the CLI?  Is it worth it?  Too much
> trouble for something that 'works'?  Of course this would
> break the existing CLI, but if folks agree this is a good idea, now
> is the time to move this forward.
>
> Cheers
>
> ..Tom
> _______________________________________________
> pycsw-devel mailing list
> pycsw-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pycsw-devel




-- 
___________________________ ___ __
Ricardo Garcia Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pycsw-devel/attachments/20160423/0738dad0/attachment.html>


More information about the pycsw-devel mailing list