Revision: 148
Author: janne.t.harkonen
Date: Fri Aug 24 04:20:25 2012
Log: moved ClientConfgi to core
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=148
Modified:
/trunk/src/SSHLibrary/__init__.py
/trunk/src/SSHLibrary/core.py
=======================================
--- /trunk/src/SSHLibrary/__init__.py Fri Aug 24 04:20:13 2012
+++ /trunk/src/SSHLibrary/__init__.py Fri Aug 24 04:20:25 2012
@@ -20,10 +20,10 @@
from robot import utils
-from config import (Configuration, StringEntry, NewlineEntry, TimeEntry,
- IntegerEntry, LogLevelEntry)
from connectioncache import ConnectionCache
-from core import AuthenticationException
+from core import AuthenticationException, ClientConfig
+from config import (Configuration, StringEntry, NewlineEntry, TimeEntry,
+ LogLevelEntry)
from deprecated import DeprecatedSSHLibraryKeywords
from version import VERSION
if utils.is_jython:
@@ -34,32 +34,6 @@
__version__ = VERSION
-class DefaultConfig(Configuration):
-
- def __init__(self, timeout, newline, prompt, log_level):
- Configuration.__init__(self,
- timeout=TimeEntry(timeout or 3),
- newline=NewlineEntry(newline or 'LF'),
- prompt=StringEntry(prompt),
- log_level=LogLevelEntry(log_level or 'INFO'))
-
-
-class ClientConfig(Configuration):
-
- def __init__(self, host, alias, port, timeout, newline, prompt,
- term_type, width, height, defaults):
- Configuration.__init__(self,
- host=StringEntry(host),
- alias=StringEntry(alias),
- port=IntegerEntry(port or 22),
- timeout=TimeEntry(timeout or defaults.timeout),
- newline=StringEntry(newline or defaults.newline),
- prompt=StringEntry(prompt or defaults.prompt),
- term_type=StringEntry(term_type or 'vt100'),
- width=IntegerEntry(width or 80),
- height=IntegerEntry(height or 24))
-
-
class SSHLibrary(DeprecatedSSHLibraryKeywords):
"""SSH Library is a test library for Robot Framework that enables
executing commands and transferring files over an SSH connection.
@@ -706,3 +680,13 @@
if not raise_if_invalid:
return False
raise AssertionError("Invalid log level '%s'" % level)
+
+
+class DefaultConfig(Configuration):
+
+ def __init__(self, timeout, newline, prompt, log_level):
+ Configuration.__init__(self,
+ timeout=TimeEntry(timeout or 3),
+ newline=NewlineEntry(newline or 'LF'),
+ prompt=StringEntry(prompt),
+ log_level=LogLevelEntry(log_level or 'INFO'))
=======================================
--- /trunk/src/SSHLibrary/core.py Wed Aug 22 21:55:51 2012
+++ /trunk/src/SSHLibrary/core.py Fri Aug 24 04:20:25 2012
@@ -12,6 +12,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from config import Configuration, StringEntry, TimeEntry, IntegerEntry
+
+
+class ClientConfig(Configuration):
+
+ def __init__(self, host, alias, port, timeout, newline, prompt,
+ term_type, width, height, defaults):
+ Configuration.__init__(self,
+ host=StringEntry(host),
+ alias=StringEntry(alias),
+ port=IntegerEntry(port or 22),
+ timeout=TimeEntry(timeout or defaults.timeout),
+ newline=StringEntry(newline or defaults.newline),
+ prompt=StringEntry(prompt or defaults.prompt),
+ term_type=StringEntry(term_type or 'vt100'),
+ width=IntegerEntry(width or 80),
+ height=IntegerEntry(height or 24))
+
class AuthenticationException(RuntimeError):
pass