blob: c2637b3dfdbfc9278d93eee6eb58f8605b40ab54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/env python
'''This uploads the latest pexpect package to sourceforge.
'''
import pexpect
import sys
child = pexpect.spawn('ftp upload.sourceforge.net')
child.logfile = sys.stdout
child.expect('Name .*: ')
child.sendline('anonymous')
child.expect('Password:')
child.sendline('noah@noah.org')
child.expect('ftp> ')
child.sendline('cd /incoming')
child.expect('ftp> ')
child.sendline('lcd dist')
child.expect('ftp> ')
child.sendline('bin')
child.expect('ftp> ')
child.sendline('prompt')
child.expect('ftp> ')
child.sendline('mput pexpect-*.tar.gz')
child.expect('ftp> ')
child.sendline('ls pexpect*')
child.expect('ftp> ')
print child.before
child.sendline('bye')
|