Skip to content

Conversation

@eliasdorneles
Copy link
Member

I was playing around with scrapely cmdline tool, and I found out that it does not forgive an user error very much. =)
Here is my attempt to improve things a little bit.

Summary of the changes:

  1. Changed all commands to a descriptive form, keeping previous command names as aliases. As the cmd module has some basic autocomplete, long descriptive names work better specially for the first-time user.
  2. Alert the user when he forgets to provide a template_id instead of exiting the session
  3. Attempts to fix incomplete URLs like www.example.com instead of http://www.example.com
  4. Removed test command method, keeping backwards compatibility using an alias for the annotate command (which does the same thing when no field name is given).

This is a bit rough, but it should help to improve things a little.
Please let me know if you have any suggestion for improvements.

scrapely/tool.py Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catch-all excepts are usually a bad idea, what about catching IndexError?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, lemme fix that!

@kmike
Copy link
Member

kmike commented Mar 3, 2015

+1 to merge these changes once print is updated to use Python 3 compatible syntax.

@eliasdorneles
Copy link
Member Author

cool! lemme rebase it!

@eliasdorneles eliasdorneles force-pushed the cmd-tool-ui-improvements branch from b7c3e7a to ac1149d Compare March 4, 2015 01:13
@eliasdorneles
Copy link
Member Author

@kmike done!

shaneaevans added a commit that referenced this pull request Mar 11, 2015
Some usability improvements for the cmdline tool
@shaneaevans shaneaevans merged commit c70a1b9 into scrapy:master Mar 11, 2015
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.

4 participants