summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-02-04 20:39:37 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2003-02-04 20:39:37 +0000
commit5879548706306b3ba7fa88a3a72851fb463381e8 (patch)
treee2d77f4dfa148821a2d3636b52b7568c19a5070d
parent1300a94375c4b870d8bd2c55f17dce50a4a11f7c (diff)
downloadpexpect-5879548706306b3ba7fa88a3a72851fb463381e8.tar.gz
Eat my own dog food. Why do this with a shell script when it's easier
to do with pexpect? So I got rid of the shell script. git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@143 656d521f-e311-0410-88e0-e7920216d269
-rwxr-xr-xpexpect/tools/websync12
-rwxr-xr-xpexpect/tools/websync.py43
2 files changed, 43 insertions, 12 deletions
diff --git a/pexpect/tools/websync b/pexpect/tools/websync
deleted file mode 100755
index 7f3a76d..0000000
--- a/pexpect/tools/websync
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-ROOT=..
-# 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.
-ssh noah@use-pr-shell1.sourceforge.net "cd htdocs;rm index.html;wget http://www.noah.org/python/pexpect/index.html"
-ssh noah@use-pr-shell1.sourceforge.net "cd htdocs;rm clean.css;wget http://www.noah.org/python/pexpect/clean.css"
-scp $ROOT/pexpect-doc.tgz noah@use-pr-shell1.sourceforge.net:htdocs/pexpect-doc.tgz
-ssh noah@use-pr-shell1.sourceforge.net "cd htdocs;tar zxvf pexpect-doc.tgz"
-scp $ROOT/pexpect-current.tgz noah@use-pr-shell1.sourceforge.net:htdocs/pexpect-current.tgz
diff --git a/pexpect/tools/websync.py b/pexpect/tools/websync.py
new file mode 100755
index 0000000..5c913ee
--- /dev/null
+++ b/pexpect/tools/websync.py
@@ -0,0 +1,43 @@
+#!/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
+
+X = getpass.getpass('Password: ')
+
+p = pexpect.spawn ('ssh noah@use-pr-shell1.sourceforge.net "cd htdocs;rm index.html;wget http://www.noah.org/python/pexpect/index.html"')
+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;rm clean.css;wget http://www.noah.org/python/pexpect/clean.css"')
+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.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.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.expect ('password:')
+p.sendline (X)
+p.expect (pexpect.EOF)
+print p.before
+