log_redirect = open(self.log_dir+"/"+self.log_file,"w")
output_redirect = open(self.output_dir+"/"+self.output_file,"w")
+ if(DEBUG):
+ print "output redirect to file ", (self.output_dir+"/"+self.output_file)
+ print "log redirect to file ", (self.log_dir+"/"+self.log_file)
+
p=subprocess.Popen(args, shell=False, #does not create sh process
stdout=log_redirect,
stderr=output_redirect)
}
start_data_transmission = {
CLIENT: TRANSMISSION, PORT:10250,
- BASE_DIR:"/usr/bin/",
+ BASE_DIR:"/usr/bin",
TORRENT: "/home/p2p/p2p-meta/" + torrent_name+".torrent",
DL_DIR: "/home/p2p/p2p-dld/transmission",
LOG_DIR: "/home/p2p/p2p-log/transmission",
}
- response = s.send_command(START_MSG, start_data_tribler)
+ response = s.send_command(START_MSG, start_data_transmission)
print response
pid = (response.split(" "))[1]
print pid
BUFFER_SIZE = 4096
states = {} # keeps track of what kind of message was previously receveid on a socket.
- processes = {}
+ processes = {} # keeps lists of file descriptors for each process
WAITING_MSG_TYPE = 0
WAITING_START_DATA = 3
WAITING_STOP_DATA = 4
class TransmissionRun(BitTorrentClientRun):
def __init__(self, base_path):
BitTorrentClientRun.__init__(self, base_path,
- "$base_path/transmission --download-dir $download_dir --port $port $torrent_file > $output_dir/$output_file",
+ "$base_path/transmissioncli --download-dir $download_dir --port $port $torrent_file > $output_dir/$output_file",
"TR_DEBUG=2 $base_path/transmission --download-dir $download_dir --port $port $torrent_file 2> $log_dir/$log_file > $output_dir/$output_file")