@@ -41,19 +41,19 @@ class CommandRunner(object):
41
41
def send (self , local_to_remote_files ):
42
42
# Prepare the remote directory structure.
43
43
# FIXME: This could be folded into the sftp connection below.
44
- dirs_to_make = self ._dirnames (local_to_remote_files .viewvalues ())
44
+ dirs_to_make = self ._dirnames (local_to_remote_files .values ())
45
45
self .run_remote (['/bin/mkdir' , '-p' ] + dirs_to_make )
46
46
47
47
# Send the local files.
48
48
sftp_commands = ("-put {0} {1}" .format (quote (local_file ),
49
49
quote (remote_file ))
50
50
for local_file , remote_file
51
- in local_to_remote_files .viewitems ())
51
+ in local_to_remote_files .items ())
52
52
self .run_sftp (sftp_commands )
53
53
54
54
def fetch (self , local_to_remote_files ):
55
55
# Prepare the local directory structure.
56
- dirs_to_make = self ._dirnames (local_to_remote_files .viewkeys ())
56
+ dirs_to_make = self ._dirnames (local_to_remote_files .keys ())
57
57
mkdir_command = ['/bin/mkdir' , '-p' ] + dirs_to_make
58
58
if self .verbose :
59
59
print (' ' .join (mkdir_command ), file = sys .stderr )
@@ -64,11 +64,11 @@ class CommandRunner(object):
64
64
sftp_commands = ("-get {0} {1}" .format (quote (remote_file ),
65
65
quote (local_file ))
66
66
for local_file , remote_file
67
- in local_to_remote_files .viewitems ())
67
+ in local_to_remote_files .items ())
68
68
self .run_sftp (sftp_commands )
69
69
70
70
def run_remote (self , command , remote_env = {}):
71
- env_strings = ['{0}={1}' .format (k ,v ) for k ,v in remote_env .viewitems ()]
71
+ env_strings = ['{0}={1}' .format (k ,v ) for k ,v in remote_env .items ()]
72
72
remote_invocation = self .remote_invocation (
73
73
['/usr/bin/env' ] + env_strings + command )
74
74
remote_proc = self .popen (remote_invocation , stdin = subprocess .PIPE ,
@@ -213,16 +213,16 @@ def main():
213
213
remote_dir = posixpath .join (args .remote_dir , args .remote_input_prefix )
214
214
input_files = find_transfers (args .command , args .input_prefix ,
215
215
remote_dir )
216
- assert not any (upload_files . has_key ( f ) for f in input_files )
216
+ assert not any (f in upload_files for f in input_files )
217
217
upload_files .update (input_files )
218
218
if args .output_prefix :
219
219
assert not args .remote_output_prefix .startswith (".." )
220
220
remote_dir = posixpath .join (args .remote_dir , args .remote_output_prefix )
221
221
test_files = find_transfers (args .command , args .output_prefix ,
222
222
remote_dir )
223
- assert not any (upload_files . has_key ( f ) for f in test_files )
223
+ assert not any (f in upload_files for f in test_files )
224
224
upload_files .update (test_files )
225
- assert not any (download_files . has_key ( f ) for f in test_files )
225
+ assert not any (f in download_files for f in test_files )
226
226
download_files .update (test_files )
227
227
remote_test_specific_dir = remote_dir
228
228
0 commit comments