def __init__(self, basedir = None, installdir = "installed", shareddir = "shared", *args, **kw): print kw super(SoftwareAdapter, self).__init__(baseclass = SoftwarePackage, *args, **kw) if not basedir: basedir = self.get_homedir() else: basedir = Path(basedir) if not basedir.isabs(): raise ValueError("Need an absolute path for basedir, not " + str(basedir)) installdir = Path(installdir) shareddir = Path(shareddir) if not installdir.isabs(): installdir = basedir / installdir if not shareddir.isabs(): shareddir = basedir / shareddir self.basedir = basedir self.installdir = installdir self.shareddir = shareddir basedir.checkdir() shareddir.checkdir() installdir.checkdir()
def __init__(self, package, executable, fork = False, workingdir = None, makepidfile = False, daemonargs = None, ssd = "/sbin/start-stop-daemon", ldpath = None, outfile = "/dev/null", *args, **kw): super(StartStopDaemonController, self).__init__(package = package, *args, **kw) executable = Path(executable) if not executable.isabs(): executable = self.package.installdir / executable self.__executable = unicode(executable) if workingdir is not None: workingdir = Path(workingdir) if not workingdir.isabs(): workingdir = self.package.installdir / workingdir self.__workingdir = unicode(workingdir) else: self.__workingdir = self.package.installdir if ldpath is not None: if not isinstance(ldpath, (list, set, tuple, frozenset)): ldpath = [ ldpath ] ldpath = tuple(set(ldpath)) self.__ldpath = ldpath self.__makepidfile = makepidfile self.__daemonargs = daemonargs self.__fork = fork self.__ssd = ssd self.__outfile = outfile
def __init__(self, parent, manager, shelf_path = None, *args, **kw): super(ShelveConfigAdapter, self).__init__(parent = parent, manager = manager, *args, **kw) if shelf_path is None: shelf_path = self.get_storage_dir() / self.__quote() else: from path import path as Path shelf_path = Path(shelf_path) if not shelf_path.isabs(): shelf_path = self.get_storage_dir() / shelf_path if shelf_path.isdir(): shelf_path = shelf_path / self.__quote() #logger.debug("shelf path: %s" % (shelf_path, )) self.__shelf_path = shelf_path