Android RunScript in Skin
#1
Hello, everybody,

I want to query a version number in the skin. I created a small script for it.

default.py
python:
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, os, sys, xbmcvfs, HTMLParser, glob, zipfile, json
import shutil
import errno
import string
import random
import urllib2,urllib
import re
import downloader
import extract
import uservar
import skinSwitch
import time
import pyqrcode
from datetime import date, datetime, timedelta
try: from sqlite3 import dbapi2 as database
except: from pysqlite2 import dbapi2 as database
from string import digits

# EVEAM FAVO-SYSTEM
from shutil import copyfile

EVEAM_UPDATE_VERSION = 'http://update.eveam.net/version.txt'
HOME = xbmc.translatePath('special://home/')
USERDATA = os.path.join(HOME, 'userdata')
EVEAM_VERSION = os.path.join(USERDATA, 'version.txt')

def eveamLocal():
serverlink = urllib.urlopen(EVEAM_UPDATE_VERSION)
for versionserver in serverlink:
with open(EVEAM_VERSION, 'r') as file:
versionlocal = file.read().replace('\n', '')
return versionlocal

if mode==None : eveamLocal()
elif mode=='local' : eveamLocal()

Skin XML:
xml:
                <control type="label" id="">
                    <description>Eveam Youtube Version</description>
                    <width>965</width>
                    <height>40</height>
                    <!-- <label>144</label> -->
                    <label>XBMC.RunScript(plugin://script.eveam.version/default.py,mode=local)</label>
                    <align>right</align>
                    <textcolor>$VAR[Colour.500]</textcolor>
                    <font>button.bold</font>
                </control>

As I said, I only want to output the version number. But so far without success. Can someone help me out?

Best regards
Reply

Logout Mark Read Team Forum Stats Members Help
RunScript in Skin0
This forum uses Lukasz Tkacz MyBB addons.