Loading Noto/Servers/NotoPyIfDistributor/src/_ifdist.py +48 −36 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ def main(argv): commandstr=[] try: if int(argv[0]) not in range (1,3): sys.stderr.write(str('error Enter a valid input channel number')) userLogger.logError("Enter a valid input channel number") Loading @@ -101,6 +103,12 @@ def main(argv): selectedAtt=argv[2] except ValueError: sys.stderr.write(str('error Enter a numeric value')) userLogger.logError("Enter a numeric value") simpleClient.disconnect() sys.exit(1) #if selectedPol and selectedAtt are -1 print information on current pol and att if int(selectedPol) == -1 and float(selectedAtt)==-1: commandstr=[selectedInput,"att"+argv[0]] Loading @@ -115,11 +123,13 @@ def main(argv): commandstr=[selectedInput+","+selectedPol, "att"+argv[0]+","+selectedAtt] answerstr = "" for i in range(0,len(commandstr)): userLogger.logNotice("IFDist setup according to %s command"%(commandstr[i])) answer=send_command(ip,port, commandstr[i]) answerstr+= str(answer) if answer=="Fail": newEx = ComponentErrorsImpl.SocketErrorExImpl() add_user_message(newEx,"Unable to communicate to IFDist") Loading @@ -138,7 +148,9 @@ def main(argv): else: userLogger.logNotice( "Answer: %s"%(answer)) sys.stderr.write(str(answerstr)) print >> sys.stderr, answerstr.replace(","," ") if __name__=="__main__": main(sys.argv[1:]) Loading
Noto/Servers/NotoPyIfDistributor/src/_ifdist.py +48 −36 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ def main(argv): commandstr=[] try: if int(argv[0]) not in range (1,3): sys.stderr.write(str('error Enter a valid input channel number')) userLogger.logError("Enter a valid input channel number") Loading @@ -101,6 +103,12 @@ def main(argv): selectedAtt=argv[2] except ValueError: sys.stderr.write(str('error Enter a numeric value')) userLogger.logError("Enter a numeric value") simpleClient.disconnect() sys.exit(1) #if selectedPol and selectedAtt are -1 print information on current pol and att if int(selectedPol) == -1 and float(selectedAtt)==-1: commandstr=[selectedInput,"att"+argv[0]] Loading @@ -115,11 +123,13 @@ def main(argv): commandstr=[selectedInput+","+selectedPol, "att"+argv[0]+","+selectedAtt] answerstr = "" for i in range(0,len(commandstr)): userLogger.logNotice("IFDist setup according to %s command"%(commandstr[i])) answer=send_command(ip,port, commandstr[i]) answerstr+= str(answer) if answer=="Fail": newEx = ComponentErrorsImpl.SocketErrorExImpl() add_user_message(newEx,"Unable to communicate to IFDist") Loading @@ -138,7 +148,9 @@ def main(argv): else: userLogger.logNotice( "Answer: %s"%(answer)) sys.stderr.write(str(answerstr)) print >> sys.stderr, answerstr.replace(","," ") if __name__=="__main__": main(sys.argv[1:])