Gentlemen, thanks for the ideas here. By a one-liner I meant if anyone knew
of a different API call that would return the serial number alone (or have
flags to do that). Parsing the info returned in 2015 isn't an issue but
it's always better if the developer provides targeted API routines. And I
was thinking that perhaps I missed some new callback that would work for
both 2015 & 2016.

On Tue, May 5, 2015 at 6:33 AM, Anthony Tan <[email protected]>
wrote:

>  If it's a QT window, sure, with a little probing you could probably
> track down the UI element and read out the string, but I don't really think
> it's worth the effort to do it and it's an awfully brittle process. There's
> a save as button which will dump the data to a text file, but again, unless
> there's a good reason to automate this *exact* specific process, I'd find
> another way. An example: if in 2016 they're still going to run licences via
> Flex, then surely it'd be easier querying the license server? (noting i
> have zero info about 2016, it's just not something on my radar right now)
>
>
> On Tue, May 5, 2015, at 04:27 PM, Mahmoodreza Aarabi wrote:
>
> maybe we can get serial number from the "Product License Information"
> window.
> do you have any experience in this way? getting information of a window.
>  or at least if we can save information of this window to a text file we
> can easily access to information (like save as button)
>
> On Tue, May 5, 2015 at 10:49 AM, Anthony Tan <[email protected]>
> wrote:
>
>
> 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
> <https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5Z4rhUynyCxbtaP_uMtrtgpmGTpJMdyyLjS-FDt9k85iQ%40mail.gmail.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/1430805422.479626.262763805.12B70A12%40webmail.messagingengine.com
> <https://groups.google.com/d/msgid/python_inside_maya/1430805422.479626.262763805.12B70A12%40webmail.messagingengine.com?utm_medium=email&utm_source=footer>
> .
>
> 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
> <https://groups.google.com/d/msgid/python_inside_maya/CADvbQwLYdh22e%2B7hkxwZULx096cg7iS0nkcnnxxFiaBoJRa5fQ%40mail.gmail.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/1430806787.483409.262769681.20FAB442%40webmail.messagingengine.com
> <https://groups.google.com/d/msgid/python_inside_maya/1430806787.483409.262769681.20FAB442%40webmail.messagingengine.com?utm_medium=email&utm_source=footer>
> .
>
>  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/CADvbQwLL2S45Jw%2Bro_jvOyjXgnKvZ9xAjvtrejUZEQbmnyTnMA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CADvbQwLL2S45Jw%2Bro_jvOyjXgnKvZ9xAjvtrejUZEQbmnyTnMA%40mail.gmail.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/1430832793.1219598.262922949.5DE666F2%40webmail.messagingengine.com
> <https://groups.google.com/d/msgid/python_inside_maya/1430832793.1219598.262922949.5DE666F2%40webmail.messagingengine.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"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_aC5acS8yg0yuLbaJXOWz%3DwGO2sPMCtViPt3txqn6hW6bY-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to