def __parser(process, ret=True, output=False, *args, **kwargs): res = False process.wait() code = process.poll() if not isinstance(code, int): Log.fatal(Status["STAT_EXEC_ERROR"]) out_strs = [str_decode(line) for line in process.stdout.readlines()] err_strs = [str_decode(line) for line in process.stderr.readlines()] if ret: if code != 0: res = False else: res = out_strs or True if output: if code != 0: puts("\n".join(err_strs)) res = res or False else: puts("\n".join(out_strs)) res = res or True return res
def __parser(process, ret = True, output = False, *args, **kwargs): res = False process.wait() code = process.poll() if not isinstance(code, int): Log.fatal(Status["STAT_EXEC_ERROR"]) out_strs = [str_decode(line) for line in process.stdout.readlines()] err_strs = [str_decode(line) for line in process.stderr.readlines()] if ret: if code != 0: res = False else: res = out_strs or True if output: if code != 0: puts("\n".join(err_strs)) res = res or False else: puts("\n".join(out_strs)) res = res or True return res
def _help(cls, *args, **kwargs): puts(cls.__doc__)
def _version(self, *args, **kwargs): puts(LocalOperation.distr()) puts("%s %s" % (name, version))
def warn(cls, msg): puts(yellow("WARN: %s" % msg))
def info(cls, msg): puts("INFO: %s" % msg)
def puts(cls, msg): puts("%s" % msg)
def success(cls, msg): puts(green("SUCCESS: %s" % msg))
def debug(cls, msg): if debug: puts(magenta("DEBUG: %s" % msg))
def __show_pkgs(cls, pkgs): if not isinstance(pkgs, list): pkgs = [pkgs] puts("\n".join([Path2Dir(pkg) for pkg in pkgs]))