def addMedia(self): """ Add a media as APT source """ sourcesdir = "/etc/apt/sources.list.d/" if not utils.pathExists(sourcesdir): utils.mkdir(sourcesdir) self.manager.append("-o=dir::etc=" + sourcesdir) self.manager.append("-o=dir::etc::sourcelist="+ self.sourceslist) self.manager.append("--ask-cdrom") self.manager.append("&") #print self.manager process = os.popen(" ".join(self.manager), "w") process.close()
def get_path(default, destination): if not utils.pathExists(destination): return utils.normalizePath(default) else: return utils.normalizePath(destination)