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
New Click Command #1114
base: master
Are you sure you want to change the base?
New Click Command #1114
Conversation
… options. Added tests as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some small Pythonic changes.
But globally, it would better to have a list of predicates to filter the list of project, and execute this list comprehension project = []
only once.
I bet this is possible with SQLAlchemy, but don't have the time to find it, so, it will be fine for me with Python lambdas :)
if bills_high < bills_low: | ||
temp = bills_high | ||
bills_high = bills_low | ||
bills_low = temp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if bills_high < bills_low: | |
temp = bills_high | |
bills_high = bills_low | |
bills_low = temp | |
if bills_high < bills_low: | |
(bills_low, bill_high) = bills_high, bills_low |
if pr.get_bills().count() >= bills_low | ||
and pr.get_bills().count() <= bills_high |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if pr.get_bills().count() >= bills_low | |
and pr.get_bills().count() <= bills_high | |
if bills_low <= pr.get_bills().count() <= bills_high |
click.echo(len(projects)) | ||
if emails: | ||
list_emails = ", ".join(set([pr.contact_email for pr in projects])) | ||
click.echo(list_emails) | ||
if names: | ||
proj_names = [pr.name for pr in projects] | ||
click.echo(proj_names) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated code from line 155-161.
Also, maybe a default value of 0 for |
Added Click command to display the number of projects. Options exist to specify for projects within the bounds of the specified number of bills (inclusive) and/or less than x days old.