autorun: fixed smth in TransmissionRun
authorAdriana Draghici <adriana008@gmail.com>
Sat, 10 Apr 2010 14:10:08 +0000 (14:10 +0000)
committerAdriana Draghici <adriana008@gmail.com>
Sat, 10 Apr 2010 14:10:36 +0000 (14:10 +0000)
autorun/server/BitTorrentClientRun.py
autorun/server/Client.py
autorun/server/Server.py
autorun/server/TransmissionRun.py

index 935c19d..5687ceb 100644 (file)
@@ -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)
index ae461cf..943bdc3 100644 (file)
@@ -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
index 9976613..6ac9bd3 100644 (file)
@@ -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
index a1953a5..e58d82b 100644 (file)
@@ -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")