Changeset 24240 for issm/trunk-jpl/src/m/os/issmscpin.py
- Timestamp:
- 10/17/19 06:03:43 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/os/issmscpin.py
r24213 r24240 9 9 """ 10 10 ISSMSCPIN get packages from host, using scp on unix, and pscp on windows 11 12 11 usage: issmscpin(host, packages, path) 13 12 """ … … 15 14 #first get hostname 16 15 hostname = gethostname() 17 18 16 #first be sure packages are not in the current directory, this could conflict with pscp on windows. 19 17 #remove warnings in case the files do not exist … … 23 21 except OSError as e: 24 22 pass 25 26 23 #if hostname and host are the same, do a simple copy 27 if m.strcmpi(hostname, host): 28 24 if hostname == host: 29 25 for package in packages: 30 26 try: … … 32 28 except OSError as e: 33 29 pass 34 35 30 else: 36 31 if m.ispc(): … … 41 36 else: 42 37 raise OSError("issmscpin error message: could not find ISSM_DIR_WIN environment variable.") 43 44 38 username = eval(input('Username: (quoted string) ')) 45 39 key = eval(input('Key: (quoted string) ')) 46 47 40 for package in packages: 48 41 try: 49 42 subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR, username, key, host, os.path.join(path, package), os.getcwd()), shell=True) 50 43 except CalledProcessError as e: 51 raise CalledProcessError("issmscpin error message: could not call putty pscp .")44 raise CalledProcessError("issmscpin error message: could not call putty pscp due to ") 52 45 53 46 else:
Note:
See TracChangeset
for help on using the changeset viewer.