Skip to content

Commit fd41043

Browse files
Merge pull request #5 from tylercrumpton/prep/for-v1.2.0
Add support for py3.
2 parents ce9257d + 0622927 commit fd41043

File tree

6 files changed

+112
-56
lines changed

6 files changed

+112
-56
lines changed

README.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
robotframework-scplibrary
2+
=========================
3+
4+
|PyPI version| |PyPI license| |PyPI pyversions|
5+
6+
7+
Robot Framework test library for Secure Copy (SCP)
8+
--------------------------------------------------
9+
10+
This library can be used to copy files to and from a remote machine
11+
using Secure Copy (SCP). It uses the Paramiko SSH Python library (just
12+
like robotframework-sshlibrary) and an SCP wrapper (‘scp’ by James
13+
Bardin).
14+
15+
The library does not currently support Jython or IronPython at this
16+
time.
17+
18+
Installation
19+
------------
20+
21+
This library may be installed via PyPI or from the source distribution.
22+
To install using pip, run:
23+
24+
::
25+
26+
pip install robotframework-scplibrary
27+
28+
To install from the source distribution, download the repo archive and
29+
extract the source and run:
30+
31+
::
32+
33+
python setup.py install
34+
35+
Example
36+
-------
37+
38+
.. code::
39+
40+
*** Settings ***
41+
Library SCPLibrary
42+
43+
*** Test Cases ***
44+
Grab Files From My Server
45+
Open Connection 192.168.1.42 username=tyler password=teapot
46+
Get File remotefile.txt localfile.txt
47+
Get File /home/tyler/ mytylerdir/ recursive=True
48+
Close Connection
49+
50+
Put File On My Server
51+
Open Connection 192.168.1.42 username=tyler password=teapot
52+
Put File mytea.txt /home/tyler/
53+
Close Connection
54+
55+
Connection
56+
----------
57+
58+
Before files can be transferred, a connection to remote machine must
59+
first be made. A connection can be made with the ``Open Connection``
60+
keyword. Both normal username/password authentication and asymmetric
61+
key-pair authentication may be used.
62+
63+
Connections should be closed using the ``Close Connection`` keyword when
64+
they are no longer in use.
65+
66+
File transfer
67+
-------------
68+
69+
Files and directories can be uploaded to the remote machine using the
70+
``Put File`` or ``Put Directory`` keywords or downloaded to the local
71+
machine using the ``Get File`` keyword.
72+
73+
A connection must be made using the ``Open Connection`` keyword before
74+
file transfers may be made.
75+
76+
.. |PyPI version| image:: https://img.shields.io/pypi/v/robotframework-scplibrary.svg
77+
:target: https://pypi.org/project/robotframework-scplibrary/
78+
79+
.. |PyPI license| image:: https://img.shields.io/pypi/l/robotframework-scplibrary.svg
80+
:target: https://pypi.org/project/robotframework-scplibrary/
81+
82+
.. |PyPI pyversions| image:: https://img.shields.io/pypi/pyversions/robotframework-scplibrary.svg
83+
:target: https://pypi.org/project/robotframework-scplibrary/
84+

SCPLibrary/errors.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

SCPLibrary/library.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
from paramiko import SSHClient
22
from paramiko.client import AutoAddPolicy
33
from scp import SCPClient
4-
from errors import SCPNotConnectedError
4+
from six import string_types
55

66
try:
77
from _version import __version__, __revision__
88
except ImportError:
99
__version__ = "UNKNOWN"
1010
__revision__ = "UNKNOWN"
1111

12+
13+
class SCPNotConnectedError(RuntimeError):
14+
ROBOT_EXIT_ON_FAILURE = False
15+
16+
1217
class SCPLibrary(object):
1318
"""Robot Framework test library for Secure Copy (SCP).
1419
@@ -130,6 +135,6 @@ def get_file(self, remote_filepath, local_filepath, recursive=False):
130135

131136
@staticmethod
132137
def _is_true_arg(arg):
133-
if isinstance(arg, basestring):
138+
if isinstance(arg, string_types):
134139
return arg.lower() not in ['false', 'no']
135140
return bool(arg)

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
paramiko==1.15.2
2-
scp==0.10.2
1+
paramiko==2.4.1
2+
scp==0.11.0
33
robotframework==2.8.7
44
vcversioner==2.14.0.0

setup.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1+
from os import path
2+
from io import open
13
from setuptools import setup
24

5+
6+
here = path.abspath(path.dirname(__file__))
7+
8+
# Get the long description from the README file
9+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
10+
LONG_DESCRIPTION = f.read()
11+
312
config = {
413
'description': 'Robot Framework test library for transferring files via Secure Copy (SCP)',
514
'author': 'Tyler Crumpton',
6-
'url': 'http://www.tylercrumpton.com',
15+
'url': 'https://www.tylercrumpton.com',
716
'download_url': 'https://github.com/tylercrumpton/robotframework-scplibrary',
817
'author_email': '[email protected]',
918
'vcversioner': {'version_module_paths': ['SCPLibrary/_version.py']},
10-
'install_requires': ['scp', 'paramiko'],
19+
'install_requires': ['scp', 'paramiko', 'six'],
1120
'packages': ['SCPLibrary'],
1221
'scripts': [],
13-
'name': 'robotframework-scplibrary'
22+
'name': 'robotframework-scplibrary',
23+
'license': 'GPLv3',
24+
'long_description': LONG_DESCRIPTION,
25+
'project_urls': {
26+
'Bug Reports': 'https://github.com/tylercrumpton/robotframework-scplibrary/issues',
27+
'Source': 'https://github.com/tylercrumpton/robotframework-scplibrary',
28+
},
29+
1430
}
1531

1632
setup(**config)

0 commit comments

Comments
 (0)