Fix #243 Added module file for text_styling in utils#254
Fix #243 Added module file for text_styling in utils#254ShubhamPandey28 wants to merge 5 commits intoCloud-CV:masterfrom
Conversation
| for i in list(message.split("`")): | ||
|
|
||
| if index % 2: | ||
| style_message += style(i, fg="cyan") |
There was a problem hiding this comment.
Nice logic here. A small query here: what do you think about adding a check to see if the text is actually enclosed in backticks. That is, to check if there is a closing backtick and only applying this after that.
I'm not sure if it is easy to do here, but if the parts of the messages were in a list ls:
if len(ls) == ODD:
# apply command style
Let me know what you think.
Another small query: I think we can add bold=True here?
There was a problem hiding this comment.
Ya sure. both of them are doable and looks nice. I will follow it in the following PR
There was a problem hiding this comment.
Yes I will do that in following PR
| style_message += style(i, fg="red", bold=True) | ||
|
|
||
| else: | ||
| style_message += style(i, fg="green") |
There was a problem hiding this comment.
You used the error flag here to either print the error message or the success message. But there could be times when we just want to print the info with white bold text or just plain white text. Can you add that functionality here somehow? Feel free to use helper methods as mentioned in #234
Small query: bold=True?
There was a problem hiding this comment.
Ok, I will include it in following PR.
There was a problem hiding this comment.
I just followed the codes of the other files. most of the error messages where bold in those files so I kept it bold.
There was a problem hiding this comment.
I will add an argument to the functions for bold text in the following PR
|
@ShubhamPandey28 Great work on the issue and kudos on your first PR for CloudCV! 🎉 I have left a few queries, so please have a look. |
|
Also, please let me know why you chose a single method instead of several helper methods. |
|
the helper functions will be very similar in that case. But you are right, it will be more easy to maintain with those helper functions. |
Added text_styling.py which solves both issue #234 and #243 at the same time.