-
Notifications
You must be signed in to change notification settings - Fork 4
Better output formatting + ability to stop/remove boxes #2
Conversation
Thank you for the PR! I have some inline remarks. |
@click.argument('id') | ||
@click.option('--no-confirm', is_flag=True, default=False) | ||
def delete_box(id, no_confirm): | ||
if no_confirm: |
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 would like to keep the logic of the old delete_box
. It is designed to avoid an unnecessary API rountrip and be a direct mapping of the library function.
We could introduce wait-stop-and-delete
which uses the new logic. (Better names are welcome)
Hm, I'm guessing you have a vastly higher number of jiffyboxes than I have =). Some comments: Saving API round-trips is good, I just did not think it was a large issue at that point. I may be wrong, if necessary, I can put it back to one at the cost of a little legibility. Getting the Box info everytime makes for a bit better error messages though. Regarding If you do thing that it is a concern that a tool is taking a while to complete an action (which is not unhead of for unix command line tool), here's what I'd suggest to alleviate the situation (any of those below should suffice):
|
@mbr
How about a About the point about roundtrips and better error messages I now agree with you. |
It is ultimately your call =)
I am not sure if that would make a difference to jiffybox, after all someone that hasn't read the API docs (which is probably every user using the tool, since he or she would use it to avoid having to read the docs and implement things him/herself) will not deduce that the status call should be used sparingly solely from the fact that there is a confirmation prompt slapped onto it. So a better solution might be to not introduce a confirmation prompt here, but a particular warning that jiffybox asks for this functionality not to be used excessively? I do feel that this might be even better solved on jiffybox's end; if they need a rate limit, they could just introduce one - after all, each call to this API needs to be authenticated anyway. "Advising" to "not use the API continuously" is as vague as this criticism of the fact...
Showing output fast enough seems to be a minor issue if the required self-limitation is the bigger issues =) |
Okay, I am conviced :-) |
See the most recent commits. However, I've just looked into the docs and it seems there's a sentence missing from your citation above:
With that in mind, I would interpret this section solely as "if you're polling this for status, this might take longer than you'd like, poll individual boxes for better performance if you do not need all of them". It's either that or their discovery is slow. In both cases, I'd say that the warning isn't necessarily needed. I'll leave including it up to you (personally I'd just ignore it), you may want to get in touch with jiffybox and ask them about their strange docs (or why they're not providing a python lib in the first place ;)) |
@mbr |
New output format:
Additionally, it is possible to remove running boxes thanks to the added
stop()
API method: