Revision: 149
Author:   janne.t.harkonen
Date:     Fri Aug 24 04:20:36 2012
Log:      enable_ssh_logging: return True if succeeds
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=149

Modified:
 /trunk/src/SSHLibrary/__init__.py
 /trunk/src/SSHLibrary/javaclient.py
 /trunk/src/SSHLibrary/pythonclient.py

=======================================
--- /trunk/src/SSHLibrary/__init__.py   Fri Aug 24 04:20:25 2012
+++ /trunk/src/SSHLibrary/__init__.py   Fri Aug 24 04:20:36 2012
@@ -212,11 +212,7 @@
Note that this keyword only works with Python, e.g. when executing the
         tests with `pybot`
         """
-        if utils.is_jython:
- self._log('SSH logging is not supported when running on Jython.',
-                      'WARN')
-        else:
-            SSHClient.enable_ssh_logging(logfile)
+        if SSHClient.enable_logging(logfile):
self._log('SSH log is written to <a href="%s">file</a>.' % logfile,
                       'HTML')

=======================================
--- /trunk/src/SSHLibrary/javaclient.py Wed Aug 22 21:55:51 2012
+++ /trunk/src/SSHLibrary/javaclient.py Fri Aug 24 04:20:36 2012
@@ -28,6 +28,10 @@

 class JavaSSHClient(SSHClient):

+    @staticmethod
+    def enable_logging(logfile):
+        return False
+
     def _create_client(self):
         client = Connection(self.host, self.port)
         client.connect()
=======================================
--- /trunk/src/SSHLibrary/pythonclient.py       Wed Aug 22 21:55:51 2012
+++ /trunk/src/SSHLibrary/pythonclient.py       Fri Aug 24 04:20:36 2012
@@ -37,8 +37,11 @@


 class PythonSSHClient(SSHClient):
-    enable_ssh_logging = staticmethod(lambda path:
-            paramiko.util.log_to_file(path))
+
+    @staticmethod
+    def enable_logging(path):
+        paramiko.util.log_to_file(path)
+        return True

     def _create_client(self):
         client = paramiko.SSHClient()

Reply via email to