On Thu, Oct 27, 2016 at 2:16 PM likage <[email protected]> wrote:
> > 2. Is there any chance that I will need to add in an `else` statement > should the self.state not conform to either `self.STATE_ROOT_SELS` or > `self.STATE_USER_SELS`? Otherwise, I suppose I can stopped such from > happening in the run_dialog function, right? > > > Can you raise a ValueError if they don't pass a valid constant? > > > Hey Justin, was wondering if you could give me an example scenario as to > when this will occurs? > I asked because I tried selecting objects of other node types etc, I am > getting errors (need to rewrite my logic here) but only within the > `run_dialog` and it does not seems to pass in this `else` statement.. > In your run_dialog() function, it looks like there is the potential for "state" to be an empty string, and passed to your dialog constructor. If it is not acceptable for your dialog to operate without a valid state value, then your dialog should raise a ValueError. If it can operate with an invalid state value, then don't raise an exception. So in your run_dialog(), what does it mean for your dialog to receive an empty string for state? Can the dialog still be useful? > -- > 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 emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/2cd81c76-93f9-4837-81b8-be04c5d90bb4%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/2cd81c76-93f9-4837-81b8-be04c5d90bb4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1EGuYDhMYN4LDGb%2BR3uX8D%3D3Aiom_3KUz9uv85jDBK9Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
