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.
Links:
1.
https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5Z4rhUynyCxbtaP_uMtrtgpmGTpJMdyyLjS-FDt9k85iQ%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/1430805422.479626.262763805.12B70A12%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.