def loadOldPathsConf(self): try: _dict = {} _dict["xml"] = {} _dict["xml"]["filetypes"] = {} _dict["xml"]["searchpaths"] = {} fconf = open( config.plugins.pvmc.configfolderpath.value + "paths.conf", "r") _dict["xml"]["filetypes"]["filetype"] = fconf.readline().strip( ).split("|") pathsList = [] for path in fconf.readlines(): path = path.strip() p = path.split('|') path = p[0] folderType = u"MOVIE_AND_TV" if len(p) > 1: folderType = p[1] useFolder = False if len(p) > 2 and p[2] == u"FOLDERNAME": useFolder = True if len(path) > 0: enabled = True if path[0] == '#': enabled = False path = path[1:] pathsList.append({ "directory": path, "usefolder": useFolder, "enabled": enabled, "type": folderType }) _dict["xml"]["searchpaths"]["searchpath"] = pathsList print _dict["xml"] fconf.close() return _dict except Exception, ex: printl("no paths.xml or paths.conf found ...", self, "H") printl("trying to repair ...", self, "H") self.checkPathXml() printl("retrying to load ...", self, "H") Xml2Dict.__init__( self, config.plugins.pvmc.configfolderpath.value + "paths.xml") if Xml2Dict.load(self): printl("reloading worked", self, "H") _dict = Xml2Dict.get(self) return _dict else: printl("something went wrong", self, "E")
def loadOldPathsConf(self): try: _dict = {} _dict["xml"] = {} _dict["xml"]["filetypes"] = {} _dict["xml"]["searchpaths"] = {} fconf = open(config.plugins.pvmc.configfolderpath.value + "paths.conf", "r") _dict["xml"]["filetypes"]["filetype"] = fconf.readline().strip().split("|") pathsList = [] for path in fconf.readlines(): path = path.strip() p = path.split('|') path = p[0] folderType = u"MOVIE_AND_TV" if len(p) > 1: folderType = p[1] useFolder = False if len(p) > 2 and p[2] == u"FOLDERNAME": useFolder = True if len(path) > 0: enabled = True if path[0] == '#': enabled = False path = path[1:] pathsList.append({"directory": path, "usefolder": useFolder, "enabled": enabled, "type": folderType}) _dict["xml"]["searchpaths"]["searchpath"] = pathsList print _dict["xml"] fconf.close() return _dict except Exception, ex: printl("no paths.xml or paths.conf found ...", self, "H") printl("trying to repair ...", self, "H") self.checkPathXml() printl("retrying to load ...", self, "H") Xml2Dict.__init__(self, config.plugins.pvmc.configfolderpath.value + "paths.xml") if Xml2Dict.load(self): printl("reloading worked", self, "H") _dict = Xml2Dict.get(self) return _dict else: printl("something went wrong", self, "E")
def __init__(self): Xml2Dict.__init__(self, self._nameAbs)
def __init__(self): Xml2Dict.__init__(self, self._nameAbs)
def __init__(self): Xml2Dict.__init__(self, config.plugins.pvmc.configfolderpath.value + "paths.xml")
def __init__(self): Xml2Dict.__init__( self, config.plugins.pvmc.configfolderpath.value + "paths.xml")