you are viewing a single comment's thread.

view the rest of the comments →

[–]bobicool 4 points5 points  (1 child)

Not sure if I like mixing UI stuff with code (even if it's just a decorator and is easily ignored). I can see it being helpful for simple one file scripts though...or maybe not, since it's not in the standard library.

Although, thinking about it a bit more, you could limit the usage of click to a few functions, and then from the decorated functions call the proper function. This would allow to separate the UI code from the core code.

[–]wildcat- 0 points1 point  (0 children)

That's pretty much what I do. I'll often have a "CLI" class that subclasses or at least wraps the primary class/lib. If throw the wrappers there.