May have been my misread, but thought the question as a general Maya
one, with an exception needed for 2016.

2016 is a hard one to make a general case for because the entire lisc
model is getting a bit of a shake-up so it depends on what is trying to
be done (do products under subscription even have a serial number??) as
to what kind of approach you'd do there.


On Tue, May 5, 2015, at 04:06 PM, Mahmoodreza Aarabi wrote:
> But Anthony, this line does not work on maya 2016 :
> cmds.license(info=True) info flag is obsolete in 2016

>
>
> On Tue, May 5, 2015 at 10:27 AM, Anthony Tan
> <[email protected]> wrote:
>> __
>> I know, it's just parsing text, but isn't text slice pretty much a
>> one-liner anyway?
>>
>> import re import maya.cmds as mc
>>
>> print
>> re.search('serialnumber\t*(?P<serialnumber>[0-9-]*)\n',mc.license(info=True)).group('serialnumber')
>>
>> It's not as clean as say, mc.license(serial=True), and I wouldn't
>> write it out like that because it's awful to read, but it doesn't
>> strike me as a particularly hairy task. You could even just patch in
>> startup code in user.py to add the parse of the serial number etc
>> into the os.environ dictionary so you could treat it like a system
>> variable?
>>
>>
>>
>> On Tue, May 5, 2015, at 02:12 AM, Kenneth Ibrahim wrote:
>>> Simple question and hopefully 1 liner script answer :)
>>>
>>> How does one poll the serial number of the currently running Maya
>>> session?
>>>
>>> I tried the command 'license' but need to extract the serial number
>>> from the return unicode string given the 'info' option. That's fine
>>> though it seems that they would provide selectors for specific
>>> information.
>>>
>>> I can go with this but it seems that all of the options to this
>>> command have been deprecated in Maya 2016 so I'll need different
>>> approaches with different versions.
>>>
>>> Thx! Ken
>>>
>>> --
>>> "God is a metaphor for a mystery that absolutely transcends
>>> all human
categories of thought. It's as simple as that!" - Joseph Campbell
>>>


>>> --
>>> 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/CAP_aC5Z4rhUynyCxbtaP_uMtrtgpmGTpJMdyyLjS-FDt9k85iQ%40mail.gmail.com[1].
>>> 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/1430805422.479626.262763805.12B70A12%40webmail.messagingengine.com[2].
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
>
> Bests, madoodia
>


> --
> 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/CADvbQwLYdh22e%2B7hkxwZULx096cg7iS0nkcnnxxFiaBoJRa5fQ%40mail.gmail.com[3].
> For more options, visit https://groups.google.com/d/optout.



Links:

  1. 
https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5Z4rhUynyCxbtaP_uMtrtgpmGTpJMdyyLjS-FDt9k85iQ%40mail.gmail.com?utm_medium=email&utm_source=footer
  2. 
https://groups.google.com/d/msgid/python_inside_maya/1430805422.479626.262763805.12B70A12%40webmail.messagingengine.com?utm_medium=email&utm_source=footer
  3. 
https://groups.google.com/d/msgid/python_inside_maya/CADvbQwLYdh22e%2B7hkxwZULx096cg7iS0nkcnnxxFiaBoJRa5fQ%40mail.gmail.com?utm_medium=email&utm_source=footer

-- 
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/1430806787.483409.262769681.20FAB442%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to