Hi guy!
I am just wondering have you guys a good solution/method to maintain python
kwargs both short and long keywords with the same value.
(I have a couple of ideas just I am courius someone has better one.)
For example:
There is a method that eats one keyword at time (for example: "longFlag" or
"shortFlag"). It can accept a short and long keyword as well and we want to
provide a preset for this keyword if user do not use either of them.
Here is the frame:
def mayaCommandWrapper(**kwargs):
""" :keyword longFlag(shortFlag): This is a keyword flag can accept
any value. """
preset = {} # Some dictionary preset here
# Some solution here to provide long and short flags as well.
preset.update(kwargs) # we want to overwrite preset with value if given
any kind of flag.
mayaCommand(**preset) # we give the dict to the maya command as kwargs.
--
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/ea14b9fa-7e6b-4c8f-bd9d-8d396b7c5189%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.