Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
Got it, thank you. I did not read the post correctly and thought it was a case of just dict type instead of defaultdict. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread Justin Israel
On Wed, Oct 24, 2018 at 11:46 AM likage wrote: > I have 2 questions, should have done more testing on my end.. > > 1. I am trying to understand the use of `.append'. I know that it adds > things to list, but when I was looking thru the documentation page - >

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
I have 2 questions, should have done more testing on my end.. 1. I am trying to understand the use of `.append'. I know that it adds things to list, but when I was looking thru the documentation page - https://docs.python.org/2/library/collections.html, even in the example, it is mostly

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread Justin Israel
On Wed, Oct 24, 2018 at 11:25 AM likage wrote: > I was not aware that you could use `append = test_dict["Input > Issue"].append` as you have demonstrated in Example #2. > Learnt something new today :D > Hey, its Python. You can do anything you want :-) > -- > You received this message because

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
I was not aware that you could use `append = test_dict["Input Issue"].append` as you have demonstrated in Example #2. Learnt something new today :D -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread Justin Israel
That last reply didn't format nicely: # Example 1 if all((input_01, input_02)) == False: msg = "One or both of the Input fields is/ are empty!" elif input_01 == input_02: msg = "Inputs used in both fields are the same!" else: msg = validate_inputs((input_01, input_02)) if msg:

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread Justin Israel
On Wed, Oct 24, 2018 at 10:09 AM likage wrote: > Hi Justin, thanks for the reply. > I use msg{A,B,C} because if any one of the condition passed, the msg will > get appended with the next in-line error. > > Eg. If only frame range fails, my `test_dict` will return as follows: > {'Frame Range

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
Hi Justin, thanks for the reply. I use msg{A,B,C} because if any one of the condition passed, the msg will get appended with the next in-line error. Eg. If only frame range fails, my `test_dict` will return as follows: {'Frame Range Issue': [None, 'Value of Start/Min Frame

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread Justin Israel
On Wed, Oct 24, 2018 at 9:18 AM likage wrote: > Hi all, I am trying to see what is the best way that I can collate results > into a QMessageBox. > > This is my code: > test_dict = defaultdict(list) > > # Old : msg = "" > msgA = msgB = msgC = None > > # Inputs > if all((input_01, input_02)) ==