summaryrefslogtreecommitdiff
path: root/pexpect/tools/websync.py
blob: d1c782986d89c07be7d97affd48a7a90899c5d93 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python

# I use this to keep the sourceforge pages up to date with the
# latest documentation and I like to keep a copy of the distribution
# on the web site so that it will be compatible with
# The Vaults of Parnasus which requires a direct URL link to a
# tar ball distribution. I don't advertise the package this way.

import pexpect
import getpass
import sys, os

X = getpass.getpass('Password: ')

p = pexpect.spawn ('scp www/index.html noah@use-pr-shell1.sourceforge.net:htdocs/index.html')
p.logfile = sys.stdout
p.expect ('password:')
p.sendline (X)
p.expect (pexpect.EOF)
print p.before

p = pexpect.spawn ('scp www/clean.css noah@use-pr-shell1.sourceforge.net:htdocs/clean.css')
p.logfile = sys.stdout
p.expect ('password:')
p.sendline (X)
p.expect (pexpect.EOF)
print p.before

p = pexpect.spawn ('scp pexpect-doc.tgz noah@use-pr-shell1.sourceforge.net:htdocs/pexpect-doc.tgz')
p.logfile = sys.stdout
p.expect ('password:')
p.sendline (X)
p.expect (pexpect.EOF)
print p.before

p = pexpect.spawn ('ssh noah@use-pr-shell1.sourceforge.net "cd htdocs;tar zxvf pexpect-doc.tgz"')
p.logfile = sys.stdout
p.expect ('password:')
p.sendline (X)
p.expect (pexpect.EOF)
print p.before

p = pexpect.spawn ('scp pexpect-current.tgz noah@use-pr-shell1.sourceforge.net:htdocs/pexpect-current.tgz')
p.logfile = sys.stdout
p.expect ('password:')
p.sendline (X)
p.expect (pexpect.EOF)
print p.before