Status: Accepted
Owner: ----
Labels: Type-Enhancement Priority-High Target-2.0.1

New issue 97 by pekka.klarck: Add support to naming arguments passed to `SSHClient` to ease programmatic usage
http://code.google.com/p/robotframework-sshlibrary/issues/detail?id=97

Currently SSHClient (PythonSSHClient or JavaSSHClient, depending on the interpreter) only accepts `*args` that it (they) pass to AbstractSSHClient. When using the client programmatically, needing to pass all arguments positionally isn't convenient. It would be better to be able to use something like this:

    client = SSHClient('example.com', width=120, heigh=40)

There are two ways to implement this:

1) Add also `**kwargs` to SSHClient and pass both `*args` and `**kwargs` to AbstractSSHClient.

This is trivial to implement and shouldn't have any risks. A problem is that by looking at SSHClient alone, for example using introspection, you cannot see what arguments it actually accepts. This problem obviously exists already now.

2) Change PythonSSHClient and JavaSSHClient so that they don't have __init__ at all. Currently they just call parent class __init__ and set self.client. We could change AbstractSSHClient so that the last step in its __init__ would be `self.client = self._get_client()` and extending classes would implement _get_client as needed.

A benefit of this approach is that SSHClient arguments are directly visible because __init__ is inherited directly from AbstractSSHClient. This isn't too complicated to implement either. There is a small risk that in the future there would be more needs for extending classes to inherit __init__. It would be easy to start using *args and **kwargs then if needed, though.

Needed by a team at NSN using SSHClient programmatically. Targeting to 2.0.1 with high priority, but target can obviously change to 2.1 if that's the next release.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to