From: Adriana Draghici Date: Sat, 10 Apr 2010 14:10:08 +0000 (+0000) Subject: autorun: fixed smth in TransmissionRun X-Git-Tag: getopt_long~105 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=34f5320af2975a2cdc1c671be3336a228a2d8a3b;p=cs-p2p-next.git autorun: fixed smth in TransmissionRun --- diff --git a/autorun/server/BitTorrentClientRun.py b/autorun/server/BitTorrentClientRun.py index 935c19d..5687ceb 100644 --- a/autorun/server/BitTorrentClientRun.py +++ b/autorun/server/BitTorrentClientRun.py @@ -73,6 +73,10 @@ class BitTorrentClientRun: 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) diff --git a/autorun/server/Client.py b/autorun/server/Client.py index ae461cf..943bdc3 100644 --- a/autorun/server/Client.py +++ b/autorun/server/Client.py @@ -65,7 +65,7 @@ def test_all_commands(torrent_file): } 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", @@ -85,7 +85,7 @@ def test_all_commands(torrent_file): } - 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 diff --git a/autorun/server/Server.py b/autorun/server/Server.py index 9976613..6ac9bd3 100644 --- a/autorun/server/Server.py +++ b/autorun/server/Server.py @@ -20,7 +20,7 @@ class MyDaemon(Daemon): 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 diff --git a/autorun/server/TransmissionRun.py b/autorun/server/TransmissionRun.py index a1953a5..e58d82b 100644 --- a/autorun/server/TransmissionRun.py +++ b/autorun/server/TransmissionRun.py @@ -15,7 +15,7 @@ DEBUG = False 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")