#! /usr/bin/python #James Parks #06-29-04 #MCT_sender.py #the python sender for the Maya Collaboration Tool import socket import os def MCT_sender(text, host, port): remoteHostIP = socket.gethostbyname(host) localHost = socket.gethostname() print localHost maya = socket.socket(socket.AF_INET, socket.SOCK_STREAM) maya.connect((remoteHostIP, port)) isMCTopen = "if (!`window -exists MCTWin`) \n\t MCT(\"" + localHost + "\");" maya.send(isMCTopen) maya.send("$newLine = \"" + localHost + ": " + text + "\\n\";") maya.send("scrollField -e -ip 0 -it $newLine historyGrp;\n") #maya.send("shellField -e -out $newLine historyGrp;\n") maya.close() if __name__ == '__main__': import sys text = os.path.split(sys.argv[1])[1] host = os.path.split(sys.argv[2])[1] port = int(os.path.split(sys.argv[3])[1]) MCT_sender(text,host,port)