Example #1
0
def system_info():
    systime = xbmc.getInfoLabel('System.Time ')
    dns1 = xbmc.getInfoLabel('Network.DNS1Address')
    gateway = xbmc.getInfoLabel('Network.GatewayAddress')
    ipaddy = xbmc.getInfoLabel('Network.IPAddress')
    linkstate = xbmc.getInfoLabel('Network.LinkState').replace("Link:", "")
    freespace, totalspace = maintool.get_free_space_mb(os.path.join(xbmc.translatePath('special://home')))
    freespace = maintool.convert_size(freespace) + ' Free'
    totalspace = maintool.convert_size(totalspace) + ' Total'
    screenres = xbmc.getInfoLabel('system.screenresolution')
    freemem = xbmc.getInfoLabel('System.FreeMemory')
    
    # FIND WHAT VERSION OF KODI IS RUNNING
    xbmc_version = xbmc.getInfoLabel("System.BuildVersion")
    versioni = xbmc_version[:4]
    VERSIONS = {10: 'Dharma', 11: 'Eden', 12: 'Frodo', 13: 'Gotham', 14: 'Helix', 15: 'Isengard', 16: 'Jarvis', 17: 'Krypton'}
    codename = VERSIONS.get(int(xbmc_version[:2]))
    
    f = urllib.urlopen("http://www.canyouseeme.org/")
    html_doc = f.read()
    f.close()
    m = re.search('IP"\svalue="([^"]*)', html_doc)
 
    # Get Python Version
    pv = sys.version_info
    
    # System Information Menu
    kodi.addItem('[COLOR ghostwhite]Version: [/COLOR][COLOR lime]%s' % codename + " " + str(versioni) + "[/COLOR]", '', 100, artwork+'icon.png',"", description=" ")
    kodi.addItem('[COLOR ghostwhite]System Time: [/COLOR][COLOR lime]' + systime + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Gateway: [/COLOR][COLOR blue]' + gateway + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Local IP: [/COLOR][COLOR blue]' + ipaddy + '[/COLOR]', '', 100, artwork+'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]External IP: [/COLOR][COLOR blue]' + m.group(1) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]DNS 1: [/COLOR][COLOR blue]' + dns1 + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Network: [/COLOR][COLOR gold]'+linkstate + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Disc Space: [/COLOR][COLOR gold]'+str(totalspace) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Disc Space: [/COLOR][COLOR gold]'+str(freespace) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Free Memory: [/COLOR][COLOR gold]'+str(freemem) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Resolution: [/COLOR][COLOR gold]' + str(screenres) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Python Version: [/COLOR][COLOR lime]%d.%d.%d' % (pv[0], pv[1], pv[2]) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    viewsetter.set_view("files")
def system_info():
    systime = xbmc.getInfoLabel('System.Time ')
    dns1 = xbmc.getInfoLabel('Network.DNS1Address')
    gateway = xbmc.getInfoLabel('Network.GatewayAddress')
    ipaddy = xbmc.getInfoLabel('Network.IPAddress')
    linkstate = xbmc.getInfoLabel('Network.LinkState').replace("Link:", "")
    freespace, totalspace = maintool.get_free_space_mb(os.path.join(xbmc.translatePath('special://home')))
    freespace = maintool.convert_size(freespace) + ' Free'
    totalspace = maintool.convert_size(totalspace) + ' Total'
    screenres = xbmc.getInfoLabel('system.screenresolution')
    freemem = xbmc.getInfoLabel('System.FreeMemory')
    
    # FIND WHAT VERSION OF KODI IS RUNNING
    xbmc_version = xbmc.getInfoLabel("System.BuildVersion")
    versioni = xbmc_version[:4]
    VERSIONS = {10: 'Dharma', 11: 'Eden', 12: 'Frodo', 13: 'Gotham', 14: 'Helix', 15: 'Isengard', 16: 'Jarvis', 17: 'Krypton'}
    codename = VERSIONS.get(int(xbmc_version[:2]))
    
    f = urllib.urlopen("http://www.canyouseeme.org/")
    html_doc = f.read()
    f.close()
    m = re.search('IP"\svalue="([^"]*)', html_doc)
 
    # Get Python Version
    pv = sys.version_info
    
    # System Information Menu
    kodi.addItem('[COLOR ghostwhite]Version: [/COLOR][COLOR lime]%s' % codename + " " + str(versioni) + "[/COLOR]", '', 100, artwork+'icon.png',"", description=" ")
    kodi.addItem('[COLOR ghostwhite]System Time: [/COLOR][COLOR lime]' + systime + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Gateway: [/COLOR][COLOR blue]' + gateway + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Local IP: [/COLOR][COLOR blue]' + ipaddy + '[/COLOR]', '', 100, artwork+'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]External IP: [/COLOR][COLOR blue]' + m.group(1) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]DNS 1: [/COLOR][COLOR blue]' + dns1 + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Network: [/COLOR][COLOR gold]'+linkstate + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Disc Space: [/COLOR][COLOR gold]'+str(totalspace) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Disc Space: [/COLOR][COLOR gold]'+str(freespace) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Free Memory: [/COLOR][COLOR gold]'+str(freemem) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Resolution: [/COLOR][COLOR gold]' + str(screenres) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Python Version: [/COLOR][COLOR lime]%d.%d.%d' % (pv[0], pv[1], pv[2]) + '[/COLOR]', '', 100, artwork + 'icon.png', "", description=" ")
    viewsetter.set_view("files")
Example #3
0
def system_info():
    systime = xbmc.getInfoLabel('System.Time ')
    dns1 = xbmc.getInfoLabel('Network.DNS1Address')
    gateway = xbmc.getInfoLabel('Network.GatewayAddress')
    ipaddy = xbmc.getInfoLabel('Network.IPAddress')
    linkstate = xbmc.getInfoLabel('Network.LinkState').replace("Link:", "")
    freespace, totalspace = maintool.get_free_space_mb(
        os.path.join(xbmc.translatePath('special://home')))
    freespace = maintool.convert_size(freespace) + ' Free'
    totalspace = maintool.convert_size(totalspace) + ' Total'
    screenres = xbmc.getInfoLabel('system.screenresolution')
    freemem = xbmc.getInfoLabel('System.FreeMemory')

    # FIND WHAT VERSION OF KODI IS RUNNING
    xbmc_version = xbmc.getInfoLabel("System.BuildVersion")
    versioni = xbmc_version[:4]
    VERSIONS = {
        10: 'Dharma',
        11: 'Eden',
        12: 'Frodo',
        13: 'Gotham',
        14: 'Helix',
        15: 'Isengard',
        16: 'Jarvis',
        17: 'Krypton'
    }
    codename = VERSIONS.get(int(xbmc_version[:2]))

    # Get External IP Address
    try:
        ext_ip = ("blue", requests.get('https://api.ipify.org').text)
    except Exception:
        ext_ip = ("red", "IP Check Not Available")

    # Get Python Version
    pv = sys.version_info

    # System Information Menu
    kodi.addItem(
        '[COLOR ghostwhite]Version: [/COLOR][COLOR lime] %s %s[/COLOR]' %
        (codename, versioni),
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]System Time: [/COLOR][COLOR lime] %s[/COLOR]' %
        systime,
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem('[COLOR ghostwhite]Gateway: [/COLOR][COLOR blue] %s[/COLOR]' %
                 gateway,
                 '',
                 100,
                 artwork + 'icon.png',
                 "",
                 description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]Local IP: [/COLOR][COLOR blue] %s[/COLOR]' % ipaddy,
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]External IP: [/COLOR][COLOR %s] %s[/COLOR]' %
        ext_ip,
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem('[COLOR ghostwhite]DNS 1: [/COLOR][COLOR blue] %s[/COLOR]' %
                 dns1,
                 '',
                 100,
                 artwork + 'icon.png',
                 "",
                 description=" ")
    kodi.addItem('[COLOR ghostwhite]Network: [/COLOR][COLOR gold] %s[/COLOR]' %
                 linkstate,
                 '',
                 100,
                 artwork + 'icon.png',
                 "",
                 description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]Disc Space: [/COLOR][COLOR gold] %s[/COLOR]' %
        totalspace,
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]Disc Space: [/COLOR][COLOR gold] %s[/COLOR]' %
        freespace,
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]Free Memory: [/COLOR][COLOR gold] %s[/COLOR]' %
        freemem,
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]Resolution: [/COLOR][COLOR gold] %s[/COLOR]' %
        screenres,
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    kodi.addItem(
        '[COLOR ghostwhite]Python Version: [/COLOR][COLOR lime] %d.%d.%d[/COLOR]'
        % (pv[0], pv[1], pv[2]),
        '',
        100,
        artwork + 'icon.png',
        "",
        description=" ")
    viewsetter.set_view("files")
Example #4
0
def system_info():
    systime = xbmc.getInfoLabel('System.Time ')
    dns1 = xbmc.getInfoLabel('Network.DNS1Address')
    gateway = xbmc.getInfoLabel('Network.GatewayAddress')
    ipaddy = xbmc.getInfoLabel('Network.IPAddress')
    linkstate = xbmc.getInfoLabel('Network.LinkState').replace("Link:", "")
    freespace, totalspace = maintool.get_free_space_mb(os.path.join(kodi.translate_path('special://home')))
    freespace = maintool.convert_size(freespace)
    totalspace = maintool.convert_size(totalspace)
    screenres = xbmc.getInfoLabel('system.screenresolution')
    freemem = maintool.convert_size(maintool.revert_size(xbmc.getInfoLabel('System.FreeMemory')))
    
    # FIND WHAT VERSION OF KODI IS RUNNING
    # xbmc_version = xbmc.getInfoLabel("System.BuildVersion")
    # versioni = xbmc_version[:4]
    # codename = kodi.get_codename()

    # Get External IP Address
    try:
        # ext_ip = ("blue", OPEN_URL('https://api.ipify.org'))
        ext_ip = ("blue", kodi.read_file('https://api.ipify.org'))
    except Exception as e:
        kodi.log(str(e))
        try:
            # link = OPEN_URL('http://whatismyip.network/')
            link = kodi.read_file('http://whatismyip.network/')
            ext_ip = ("blue", re.search('>My IP Address[^=]*[^>]*>([^<]*)', link).group(1))
        except TypeError:
            ext_ip = ("red", "IP Check Not Available")

    # Get Python Version
    pv = sys.version_info
    
    # System Information Menu
    # kodi.add_item('[COLOR ghostwhite]Version: [/COLOR][COLOR lime] %s %s[/COLOR]' % (codename, versioni),
    #              '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]Version: [/COLOR][COLOR lime] %s %s[/COLOR]' %
                  (kodi.get_codename(), xbmc.getInfoLabel("System.BuildVersion").split('Git')[0]), '',
                  100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]System Time: [/COLOR][COLOR lime] %s[/COLOR]' % systime,
                  '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]Gateway: [/COLOR][COLOR blue] %s[/COLOR]' % gateway,
                  '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]Local IP: [/COLOR][COLOR blue] %s[/COLOR]' % ipaddy,
                  '', 100, artwork+'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]External IP: [/COLOR][COLOR %s] %s[/COLOR]' % ext_ip,
                  '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]DNS 1: [/COLOR][COLOR blue] %s[/COLOR]' % dns1,
                  '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]Network: [/COLOR][COLOR gold] %s[/COLOR]' % linkstate,
                  '', 100, artwork + 'icon.png', "", description=" ")
    if str(totalspace) != '0 B':
        kodi.add_item('[COLOR ghostwhite]Total Disc Space: [/COLOR][COLOR gold] %s[/COLOR]' % totalspace,
                      '', 100, artwork + 'icon.png', "", description=" ")
    if str(freespace) != '0 B':
        kodi.add_item('[COLOR ghostwhite]Free Disc Space: [/COLOR][COLOR gold] %s[/COLOR]' % freespace,
                      '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]Free Memory: [/COLOR][COLOR gold] %s[/COLOR]' % freemem,
                  '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]Resolution: [/COLOR][COLOR gold] %s[/COLOR]' % screenres,
                  '', 100, artwork + 'icon.png', "", description=" ")
    kodi.add_item('[COLOR ghostwhite]Python Version: [/COLOR][COLOR lime] %d.%d.%d[/COLOR]' % (pv[0], pv[1], pv[2]),
                  '', 100, artwork + 'icon.png', "", description=" ")
    viewsetter.set_view("files")
Example #5
0
def system_info():
    systime = xbmc.getInfoLabel('System.Time ')
    dns1 = xbmc.getInfoLabel('Network.DNS1Address')
    gateway = xbmc.getInfoLabel('Network.GatewayAddress')
    ipaddy = xbmc.getInfoLabel('Network.IPAddress')
    linkstate = xbmc.getInfoLabel('Network.LinkState').replace("Link:", "")
    freespace, totalspace = maintool.get_free_space_mb(os.path.join(xbmc.translatePath('special://home')))
    freespace = maintool.convert_size(freespace)
    totalspace = maintool.convert_size(totalspace)
    screenres = xbmc.getInfoLabel('system.screenresolution')
    freemem = maintool.convert_size(maintool.revert_size(xbmc.getInfoLabel('System.FreeMemory')))
    
    # FIND WHAT VERSION OF KODI IS RUNNING
    # xbmc_version = xbmc.getInfoLabel("System.BuildVersion")
    # versioni = xbmc_version[:4]
    # codename = kodi.get_codename()

    # Get External IP Address
    try:
        # ext_ip = ("blue", OPEN_URL('https://api.ipify.org'))
        ext_ip = ("blue", kodi.read_file('https://api.ipify.org'))
    except Exception as e:
        kodi.log(str(e))
        try:
            # link = OPEN_URL('http://whatismyip.network/')
            link = kodi.read_file('http://whatismyip.network/')
            ext_ip = ("blue", re.search('>My IP Address[^=]*[^>]*>([^<]*)', link).group(1))
        except:
            ext_ip = ("red", "IP Check Not Available")

    # Get Python Version
    pv = sys.version_info
    
    # System Information Menu
    # kodi.addItem('[COLOR ghostwhite]Version: [/COLOR][COLOR lime] %s %s[/COLOR]' % (codename, versioni),
    #              '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Version: [/COLOR][COLOR lime] %s %s[/COLOR]' %
                 (kodi.get_codename(), xbmc.getInfoLabel("System.BuildVersion").split('Git')[0]),'',
                 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]System Time: [/COLOR][COLOR lime] %s[/COLOR]' % systime,
                 '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Gateway: [/COLOR][COLOR blue] %s[/COLOR]' % gateway,
                 '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Local IP: [/COLOR][COLOR blue] %s[/COLOR]' % ipaddy,
                 '', 100, artwork+'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]External IP: [/COLOR][COLOR %s] %s[/COLOR]' % ext_ip,
                 '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]DNS 1: [/COLOR][COLOR blue] %s[/COLOR]' % dns1,
                 '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Network: [/COLOR][COLOR gold] %s[/COLOR]' % linkstate,
                 '', 100, artwork + 'icon.png', "", description=" ")
    if str(totalspace) != '0 B':
        kodi.addItem('[COLOR ghostwhite]Total Disc Space: [/COLOR][COLOR gold] %s[/COLOR]' % totalspace,
                     '', 100, artwork + 'icon.png', "", description=" ")
    if str(freespace) != '0 B':
        kodi.addItem('[COLOR ghostwhite]Free Disc Space: [/COLOR][COLOR gold] %s[/COLOR]' % freespace,
                     '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Free Memory: [/COLOR][COLOR gold] %s[/COLOR]' % freemem,
                 '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Resolution: [/COLOR][COLOR gold] %s[/COLOR]' % screenres,
                 '', 100, artwork + 'icon.png', "", description=" ")
    kodi.addItem('[COLOR ghostwhite]Python Version: [/COLOR][COLOR lime] %d.%d.%d[/COLOR]' % (pv[0], pv[1], pv[2]),
                 '', 100, artwork + 'icon.png', "", description=" ")
    viewsetter.set_view("files")