Skip to content

Commit

Permalink
added 1 new keyword, version number updated
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalpy committed Dec 25, 2017
1 parent 0713292 commit 42a8e07
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 58 deletions.
275 changes: 223 additions & 52 deletions FtpLibrary.html

Large diffs are not rendered by default.

24 changes: 19 additions & 5 deletions FtpLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class FtpLibrary(object):
"""
This library provides functionality of FTP client.
Version 1.4 released on 17th of May 2017
Version 1.5 released on 25th of December 2017
What's new in release 1.4:
- running library remotely
- IronPython compatibility issue fixed by [https://github.com/jpeltonen|Jarkko Peltonen]
What's new in release 1.5:
- Python 3 support by [https://github.com/DirkRichter|Dirk Richter]
- New Keyword Dir Names
FTP communication provided by ftplib.py
Expand Down Expand Up @@ -213,7 +213,7 @@ def cwd(self, directory, connId='default'):

def dir(self, connId='default'):
"""
Returns list of contents of current directory.
Returns list of raw lines returned as contens of current directory.
Parameters:
- connId(optional) - connection identifier. By default equals 'default'
"""
Expand All @@ -230,6 +230,20 @@ def dir(self, connId='default'):
logger.info(outputMsg)
return dirList

def dir_names(self, connId='default'):
"""
Returns list of files (and/or directories) of current directory.
Parameters:
- connId(optional) - connection identifier. By default equals 'default'
"""
files_list = []
thisConn = self.__getConnection(connId)
try:
files_list = thisConn.nlst()
except:
files_list = []
return files_list

def mkd(self, newDirName, connId='default'):
"""
Creates new directory on FTP server. Returns new directory path.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ What's new in release 1.4:
- running library remotely
- IronPython compatibility issue fixed by Jarkko Peltonen

Version 1.5 released on 25th of December 2017

What's new in release 1.5:
- Python 3 support by Dirk Richter
- New Keyword Dir Names

## Installation
- run command: **pip install robotframework-ftplibrary**

Expand Down
3 changes: 3 additions & 0 deletions ftpLibraryExample.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ the_simplest_example_public_ftp
comment Public FTP server IP address taken from http://stackoverflow.com/questions/7968703/is-there-a-public-ftp-server-to-test-upload-and-download
ftp connect ${public_address}
@{dirResult}= dir
Log ${dirResult}
@{files}= dir names
Log ${files}
${pwdMsg}= pwd
download file ${public_file_name}
ftp close
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from distutils.core import setup

setup(name='robotframework-ftplibrary',
version='1.4',
version='1.5',
description='Robot Framework Ftp Library',
author='Marcin Kowalczyk',
license='GPLv3',
Expand Down

0 comments on commit 42a8e07

Please sign in to comment.