All pastes #88821 Raw Edit

Donno

public python v1 · immutable
#88821 ·published 2006-07-15 10:34 UTC
rendered paste body
    def load(self,path):        self.strings = {}        tempstrings = []        self.language = xbmc.getLanguage().lower()        if os.path.exists(path+self.language+".xml"):            self.foundlang = self.language        else:            self.foundlang = "english"        self.langdoc = path+self.foundlang+".xml"        print "-Loading Language: " + self.foundlang        try:            f=open(self.langdoc,'r')            tempstrings=f.read()            f.close()        except:            print "Error: Languagefile "+self.langdoc+" cant be opened"        self.exp='<string id="(.*?)">(.*?)</string>'        self.res=re.findall(self.exp,tempstrings)        for stringdat in self.res:            self.strings[int(stringdat[0])] = str(stringdat[1])