Revision: 304f3c822cd4
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 06:29:29 2013
Log: Using basename() and dirname() instead of os.path.split()
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=304f3c822cd4
Modified:
/src/SSHLibrary/abstractclient.py
=======================================
--- /src/SSHLibrary/abstractclient.py Mon Jul 29 06:19:14 2013
+++ /src/SSHLibrary/abstractclient.py Mon Jul 29 06:29:29 2013
@@ -316,7 +316,7 @@
def get_dir(self, source, destination, path_separator='/'):
remotefiles = []
localfiles = []
- subdirs = [os.path.split(source)[1]]
+ subdirs = [os.path.basename(source)]
for path in subdirs:
[subdirs.append(path_separator.join([path, subdir_name]))
for subdir_name in self._listdirs(path)]
@@ -362,7 +362,7 @@
dest = os.path.abspath(dest.replace('/', os.sep))
self._create_missing_local_dirs(dest, is_dir)
if is_dir:
- return [os.path.join(dest, os.path.split(name)[1])
+ return [os.path.join(dest, os.path.basename(name))
for name in sourcefiles]
return [dest]
@@ -373,8 +373,8 @@
os.makedirs(dest)
def put_dir(self, source, destination, mode, newline,
path_separator='/'):
- os.chdir(os.path.split(source)[0])
- parent = os.path.split(source)[1]
+ os.chdir(os.path.dirname(source))
+ parent = os.path.basename(source)
localfiles = []
remotefiles = []
for path, _, files in os.walk(parent):
@@ -427,7 +427,7 @@
if filename:
files = [path_separator.join([dirpath, filename])]
else:
- files = [path_separator.join([dirpath, os.path.split(path)[1]])
+ files = [path_separator.join([dirpath, os.path.basename(path)])
for path in sources]
return files, dirpath
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.