manu-chroma / username-availability-checker

Live at : https://username-check.herokuapp.com/
94 stars 37 forks source link

Check script directory for websites.yml #105

Closed bcoles closed 5 years ago

bcoles commented 5 years ago

Seems like this would be a good idea; allowing the CLI to be invoked from outside the script directory.

Tested with the cli.py

seeeturtle commented 5 years ago

I agree makingcli.py available to use from outside of project directory, but I don't know if there are any benefits we get when we do the same for username_api.py.

Also, if it's intended to use cli outside, I think guide for it should be added. (i.e. alias, exporting)

Btw, thank you for contributing this project :)

bcoles commented 5 years ago

@seeeturtle I ran into an issue where using an absolute path inside cli.py was insufficient, without also modifying username_api.py, as cli.py uses from username_api import check_username, which contains the same code to load the YAML file.

seeeturtle commented 5 years ago

Sorry, I missed it. hmm... how about just modify username_api.patterns from cli.py?

seeeturtle commented 5 years ago

By the way, I think the data should be an argument of function not a global variable. maybe we can add option for using custom data instead of default data.

How do you think about it, @jayvdb, @manu-chroma ?

bcoles commented 5 years ago

hmm... how about just modify username_api.patterns from cli.py?

That's a much better idea.

I'm done here. This PR should not be merged as is. I'll leave the PR open for discussion.

seeeturtle commented 5 years ago

@bcoles instead of leaving PR open, i'll just open an issue.