yeatmanlab / AFQ-Browser

Browser-based visualization tools for AFQ results
BSD 3-Clause "New" or "Revised" License
33 stars 15 forks source link

Add title, subtitle, href prompts to afqbrowser-assemble #245

Closed richford closed 6 years ago

richford commented 6 years ago

Addresses #232. afqbrowser-assemble now prompts the user for their desired title, subtitle, and hrefs.

richford commented 6 years ago

@arokem and @jyeatman, please take a look and see if this meets your desires for expected behavior. Later, I'll add some content to the documentation about how to change these settings after-the-fact.

arokem commented 6 years ago

You're probably already on it, and I haven't looked at this in detail, but: all reads from stdin need to be done through the CLI, and input into the function needs to be given as function inputs.

richford commented 6 years ago

Yep. Just pushed a change for that. This is better anyway b/c now the user can supply the title, subtitle, etc. as CLI args instead of waiting to be prompted. If they don't supply the args, then afqbrowser-assemble will fallback to prompting them for input.

arokem commented 6 years ago

This doesn't work for me, if I just run:

./bin/afqbrowser-assemble ~/tmp/ ./afqbrowser/site/client/data/afq.mat

from the source directory, I get the following:

usage: afqbrowser-assemble [-h] [-t target] [-m metadata] [--page-title title]
                           [--page-subtitle subtitle] [--page-title-link link]
                           [--page-subtitle-link sublink]
                           source
afqbrowser-assemble: error: unrecognized arguments: ./afqbrowser/site/client/data/afq.mat

And running it with minimal inputs:

./bin/afqbrowser-assemble ./afqbrowser/site/client/data/afq.mat

I get:

Traceback (most recent call last):
  File "./bin/afqbrowser-assemble", line 47, in <module>
    title=args.title, subtitle=args.subtitle,
AttributeError: 'Namespace' object has no attribute 'title'

How would you run this with minimal inputs?

richford commented 6 years ago

Oops. I fixed the AttributeErrors. Should work now with minimal inputs. As for the first question, I believe that all the arguments except for source require some sort of flag, e.g. -t or --page-title. Thanks for catching the AttributeError.

arokem commented 6 years ago

Yes - works now! And it makes sense that it wouldn't work with positional arguments.

arokem commented 6 years ago

I made a small PR against your branch, with some edits to the documentation. When that lands, I think that we can merge this.

richford commented 6 years ago

Thanks. Merged.