Is no one concerned that anyone writing a command-line tool that leverages skimage.io will have their help menu overridden? (If they have GStreamer installed.)


On Wed, Apr 10, 2013 at 12:23 AM, Juan Nunez-Iglesias <jni.soma@gmail.com> wrote:
Hi All,

Consider the following code, saved in a file called test.py:

import gst
I will bet that few among you would predict this output:

$ python test.py -h
Usage:
  test.py [OPTION...] - GStreamer initialization

Help Options:
  -h, --help                        Show help options
  --help-all                        Show all help options
  --help-gst                        Show GStreamer Options

It seems that someone forgot an

if __name__ == '__main__'

guard somewhere!

Now, this would be none of our concern except for the following corollary:

$ python -c 'from skimage.io.collection import alphanumeric_key' -h
Usage:
  -c [OPTION...] - GStreamer initialization

Help Options:
  -h, --help                        Show help options
  --help-all                        Show all help options
  --help-gst                        Show GStreamer Options

Now, I don't know how to fix this, because it make sense that `io` would import `video` (although `from .video import *` is sloppy). But any suggestions are very very welcome.

Juan.