<client id="tribler">
<run type="script">
<file>Tribler/Tools/cmdline.py</file>
- <interpreter>python</file>
+ <interpreter>python </interpreter>
<prefix>PYTHONPATH=.</prefix>
<suffix></suffix>
</run>
<upload_limit_option></upload_limit_option>
<download_limit_option></download_limit_option>
<port_option>-p</port_option>
- <logging_dir_option>-l</port_option>
+ <logging_dir_option>-l</logging_dir_option>
<download_dir_option>-d</download_dir_option>
</client>
<client id="libtorrent">
<run type="executable">
<file>hrktorrent</file>
+ <interpreter></interpreter>
+ <prefix></prefix>
+ <suffix></suffix>
</run>
<port_option>-p</port_option>
<download_dir_option>-d</download_dir_option>
<client id="transmission">
<run type="executable">
<file>src/transmission-cli</file>
+ <interpreter></interpreter>
+ <prefix></prefix>
+ <suffix></suffix>
</run>
<upload_limit_option>-u</upload_limit_option>
<download_limit_option>-d</download_limit_option>
<port_option>-p</port_option>
- <logging_dir_option>-l</port_option>
+ <logging_dir_option>-l</logging_dir_option>
<download_dir_option>-o</download_dir_option>
</client>
</clients>
--- /dev/null
+from lxml import etree
+
+class SwarmInstance:
+ def __init__(self, id, list):
+ self.id = id;
+ self.node_id = list[0];
+ self.btclient = list[1];
+ self.upload_limit = list[2];
+ self.download_limit = list[3];
+ self.port = list[4];
+ self.download_dir = list[5];
+ self.upload_dir = list[6];
+
+ def __str__(self):
+ return '[%s: %s: %s: %s: %s: %s: %s: %s]' \
+ %(self.id, self.node_id, self.btclient, self.upload_limit, \
+ self.download_limit, self.port, self.upload_dir, self.download_dir);
+
+class NodeConfig:
+ def __init__(self, list):
+ self.id = list[0];
+ self.public_address = list[1];
+ self.public_port = list[2];
+ self.private_address = list[3];
+ self.private_port = list[4];
+ self.ssh_port= list[5];
+ self.clients_base_dir = list[6];
+
+ #~ def __str__(self):
+ #~ return '[%s: %s: %s: %s: %s: %s: %s]' \
+ #~ %(self.id, self.btclient, self.upload_limit, self.download_limit, self.port, self.upload_dir, self.download_dir);
+
+class ClientConfig:
+ def __init__(self, id, node_path, filetype, options):
+ self.id = id;
+ self.node_path = node_path;
+ self.filetype = filetype;
+ self.options = options;
+ #~ self.upload_limit_option= list[2];
+ #~ self.download_limit_option = list[3];
+ #~ self.port_option = list[4];
+ #~ self.logging_dir_option = list[5];
+ #~ self.download_dir_option = list[6];
+
+ #~ def __str__(self):
+ #~ return '[%s: %s: %s: %s: %s: %s: %s]' \
+ #~ %(self.id, self.btclient, self.upload_limit, self.download_limit, self.port, self.upload_dir, self.download_dir);
+
+class FileType:
+ def __init__(self, list):
+ self.type = list[0];
+ self.file = list[1];
+ self.interpreter = list[2];
+ self.prefix = list[3];
+ self.sufix = list[4];
+
+ def __str__(self):
+ return '[%s: %s: %s: %s: %s: %s: %s]' \
+ %(self.id, self.btclient, self.upload_limit, self.download_limit, self.port, self.upload_dir, self.download_dir);
+
+#~ tree = etree.parse("swarm.xml")
+#~ root = tree.getroot()
+#~ for elem in root:
+ #~ swn = SwarmInstance(elem.get("id"), [elemelem.text for elemelem in elem])
+ #~ print swn
+ #~ print "=================================="
+
+try:
+ tree = etree.parse("clients.xml")
+ root = tree.getroot()
+ dict = {}
+ for elem in root:
+ id = elem.get("id")
+ options = [elem2.text for elem2 in elem[1:]]
+ filetype = [elem[0].get("type")]
+ filetype.extend([elem2.text for elem2 in elem[0]])
+ dict[id] = [options, filetype]
+except IOError as e:
+ print e
+
+try:
+ tree = etree.parse("nodes.xml")
+ root = tree.getroot()
+ for elem in root:
+ list = [elem.get("id")]
+ list.extend([elem2.text for elem2 in elem[:len(elem)-1]])
+ dict = {}
+ for elem2 in elem[len(elem)-1]:
+ dict[elem2.get("id")]=elem2[0].text;
+ list.append(dict)
+ print list
+ print "=================================="
+except IOError as e:
+ print e
--- /dev/null
+import paramiko
+import os
+paramiko.util.log_to_file('/tmp/paramiko.log')
+
+client = paramiko.SSHClient()
+client.load_system_host_keys()
+client.connect(hostname='p2p-next-07.grid.pub.ro', username='p2p')
+stdin, stdout, stderr = client.exec_command('ls -l')
+
+#~ host = "p2p-next-09.grid.pub.ro"
+#~ port = 22
+#~ transport = paramiko.Transport((host, port))
+
+#~ privatekeyfile = os.path.expanduser('~/.ssh/id_rsa')
+#~ mykey = paramiko.RSAKey.from_private_key_file(privatekeyfile)
+#~ username = 'p2p'
+#~ transport.connect(username = username, pkey = mykey)
+