#modPath=modPath.replace("_debug","_release")
    sys.path.append(modPath)
    print("added module path "+modPath)
    

findRR_Root()
import libpyRR2 as rrLib


### --------------------------------------------------------------------- INIT
print("Set up server and login info.")
#A login is required if you have enabled 'Auth required for all connections' in rrConfig tab rrLogin
#Or if you connect via an router (router has to be setup in rrConfig as well)
#Note:  tcp does not keep an open connection to the rrServer.
#Every command re-connects to the server
tcp = rrLib._rrTCP("")
rrServer=tcp.getRRServer()   #This function does only work in your company. It uses the RR_ROOT environment installed by rrWorkstationInstaller
if (len(rrServer)==0):
    print (tcp.errorMessage())
if not tcp.setServer(rrServer, 7773):
    print ("Error setServer: "+ tcp.errorMessage())
    sys.exit()
tcp.setLogin("TestUser", "Password")


jobUserName="******"               #retrieve only job details of user "renderfarm" to resuce network traffic, rrServer workload and this Pythons memory.
tcp.jobSetFilter(jobUserName);

import socket
this_machine=socket.gethostname()
clientApplyList=[] 
示例#2
0
文件: rr_test.py 项目: T00N3/T00N3Kit
import scramble

import libpyRR2

if __name__ == "__main__":
    tcp = libpyRR2._rrTCP("")
    print tcp.getRRServer()

    clients = tcp.clients
    print clients.count()

    jobs = tcp.jobs

print "Deleting this job from the RR queue"

modPath=rrGlobal.rrModPyrrPath()

sys.path.append(modPath)
print("added module path "+modPath)
import libpyRR2 as rr


import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-jid")
parser.add_argument("-authstr")
args = parser.parse_args()


print("Set up server and login info")
tcp = rr._rrTCP("")
tcp.setServer(rrGlobal.rrServer(), 7773)
tcp.setLogin(args.authstr, "")


print("Sending Job Command")
jobsApply=[]
jobsApply.append(int(args.jid))
tcp.jobSendCommand(jobsApply,rrJob._LogMessage.lDelete,0)

print "done"