def _para(self, *paraArgs): """ssh to the remote machine and run the para command. paraArgs are passed as arguments to the para command. Returns stdout as a list of lines, stderr in ProcException if the remote program encouners an error. There is a possibility for quoting hell here.""" remCmd = "cd " + self.paraDir + "; para " + " ".join(paraArgs) fileOps.prLine(sys.stderr, "ssh ", self.paraHost, " ", remCmd) return procOps.callProcLines( ["ssh", "-o", "ClearAllForwardings=yes", self.paraHost, remCmd])
def dump(self, fh, desc=None): self.__calcParams() if desc != None: prLine(fh, desc) prLine(fh, " data: len: ", len(self.data), " min: ", self.data.min, " max: ", self.data.max) prLine(fh, " bins: num: ", self.numBins, " size: ", self.binSize, " min: ", self.binMin, " max: ", self.binMax) prLine(fh, " use: num: ", self.numBinsUse, " size: ", self.binSizeUse, " min: ", self.binMinUse, " max: ", self.binMaxUse, " floor: ", self.binFloorUse, " ceil: ", self.binCeilUse)
def prExceptions(er, ex): "print and exception and any recorded ones" sys.stdout.flush() sys.stderr.flush() fh = sys.stderr fileOps.prLine(fh, "\n"+strOps.dup(78, '=')) fileOps.prLine(fh, "Unexpected exception:") fileOps.prLine(fh, ProcException.formatExcept(ex)) for e in er.errors: fileOps.prLine(fh, strOps.dup(78, '-')) fileOps.prLine(fh, ProcException.formatExcept(e)) fileOps.prLine(fh, strOps.dup(78, '^')) sys.stderr.flush()
def dump(self, fh): "print content to file" prLine(fh, "query: ", self.qSeq) prLine(fh, "target: ", self.tSeq) for blk in self: blk.dump(fh)
def dump(self, fh): "print content to file" prLine(fh, "\t> query: ", self.q) prLine(fh, "\t target: ", self.t)
def prExceptions(er, ex): "print and exception and any recorded ones" sys.stdout.flush() sys.stderr.flush() fh = sys.stderr fileOps.prLine(fh, "\n" + strOps.dup(78, '=')) fileOps.prLine(fh, "Unexpected exception:") fileOps.prLine(fh, ProcException.formatExcept(ex)) for e in er.errors: fileOps.prLine(fh, strOps.dup(78, '-')) fileOps.prLine(fh, ProcException.formatExcept(e)) fileOps.prLine(fh, strOps.dup(78, '^')) sys.stderr.flush()