Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add requirements.txt to project and readme.md #20

Open
Andygmb opened this issue Jul 13, 2015 · 4 comments
Open

Add requirements.txt to project and readme.md #20

Andygmb opened this issue Jul 13, 2015 · 4 comments

Comments

@Andygmb
Copy link
Owner

Andygmb commented Jul 13, 2015

No description provided.

@Andygmb
Copy link
Owner Author

Andygmb commented Jul 13, 2015

In setup.py, perhaps it should try importing modules and if they aren't available, inform the user then raise the traceback?

eg:

try:
    from PIL import Image
except:
    print "You need PIL installed, see http://pillow.readthedocs.org/porting-pil-to-pillow.html for installation instructions."
    raise

@andrewalexander
Copy link

Yeah that seems about right. Though rather than print, why not just pass that text in as the exception text like raise("You need PIL installed, see http://pillow.readthedocs.org/porting-pil-to-pillow.html for installation instructions.")? I think it is the more pythonic way to handle it, no?

@Andygmb
Copy link
Owner Author

Andygmb commented Jul 14, 2015

My thinking with using print over raising an exception is that a lot of the people who would use this bot aren't super familiar with python and while the tracebacks from exceptions are pretty easy to understand anyhow, a lot of people see a traceback and their mind immediately shuts down.

I've had people report issues with the bot where their answer is in the traceback they paste, but they just don't seem to read it. I would hope the "prettier" print statements would help those people understand what's going wrong.

I include the exception after the print as well though, so maybe I should just switch to using Raise Exception("Error") instead - i'm open to changing it, but my main concern with all these things is to make it as easy as possible for someone who barely knows python to use the bot and not become confused.

@andrewalexander
Copy link

Ah... fair enough. I think raise Exception("Error") can be a fair compromise - have a verbose and friendly message saying in plain english what went wrong and then have the technical details above for people who know what's going on. But ultimately it's up to you 😄

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

No branches or pull requests

2 participants