Kodi Community Forum
How can you determine that XBMC is running on an iPad in Python? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+--- Thread: How can you determine that XBMC is running on an iPad in Python? (/showthread.php?tid=126834)



How can you determine that XBMC is running on an iPad in Python? - spoyser - 2012-03-27

Simple question, with hopefully a simple answer.

I am helping write a plugin which needs to modify its UI when running on an ipad, is there an easy way in python to determine this?




RE: How can you determine that XBMC is running on an iPad in Python? - Temhil - 2012-03-27

You can try something like:
Code:
import xbmc
import os
if xbmc.getCondVisibility( "system.platform.osx" ):
    if 'RELEASE_ARM' in os.uname()[3]:
        print 'ios'



RE: How can you determine that XBMC is running on an iPad in Python? - bossanova808 - 2012-03-28

Looks liek you can now do it more directly for the various platforms, no?

System.Platform.Linux Returns true if XBMC is running on a linux/unix/osx based computer.
System.Platform.Windows Returns true if XBMC is running on a windows based computer.
System.Platform.OSX Returns true if XBMC is running on an OSX based computer.
System.Platform.IOS Returns true if XBMC is running on an IOS device.
System.Platform.ATV2 Returns true if XBMC is running on an atv2.

from - http://mirrors.xbmc.org/docs/python-docs/xbmc.html
(this thread should really be moved to the addon development section BTW)



RE: How can you determine that XBMC is running on an iPad in Python? - spoyser - 2012-03-28

@Temhil
Cheers!

@bossanova808
That looks like just what I need, cheers for that.


RE: How can you determine that XBMC is running on an iPad in Python? - Temhil - 2012-03-28

Thanks for the update bossanova808, I didn't look recently at the API, good to know.

The link is actually not the one above (doc Python) but the wiki: http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions