summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoah <noah@656d521f-e311-0410-88e0-e7920216d269>2006-05-31 01:00:23 +0000
committernoah <noah@656d521f-e311-0410-88e0-e7920216d269>2006-05-31 01:00:23 +0000
commit1c582286141af1c35e5d2beffed7b7c0d52234d5 (patch)
tree78ff1a5d4367e43fff431c27867ad53eeedad85b
parent5e964a479f2afb18bdfc3aba160ab4b1b11d74f3 (diff)
downloadpexpect-1c582286141af1c35e5d2beffed7b7c0d52234d5.tar.gz
Massive rootoring of Makefile and friends.
git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@393 656d521f-e311-0410-88e0-e7920216d269
-rw-r--r--pexpect/INSTALL22
-rw-r--r--pexpect/MANIFEST10
-rw-r--r--pexpect/MANIFEST.in4
-rw-r--r--pexpect/Makefile84
-rwxr-xr-xpexpect/examples/df.py2
-rw-r--r--pexpect/pexpect.py72
-rw-r--r--pexpect/setup.py.template2
-rwxr-xr-xpexpect/tools/hash.py6
8 files changed, 99 insertions, 103 deletions
diff --git a/pexpect/INSTALL b/pexpect/INSTALL
index c54f7b6..509e925 100644
--- a/pexpect/INSTALL
+++ b/pexpect/INSTALL
@@ -1,3 +1,5 @@
+Installation
+------------
This is a standard Python Distutil distribution. To install simply run:
python setup.py install
@@ -7,3 +9,23 @@ root access to install it this way. If you do not have root access or
if you do not wish to install Pexpect so that is available to any script
then you can just copy the pexpect.py file to same directory as your script.
+Trouble on Debian and Ubuntu
+----------------------------
+For some stupid reason Debian Linux does not include the distutils module
+in the standard 'python' package. Instead, the distutils module is packaged
+separately in the 'python-dev' package. So to add distutils back
+into Python, simply use aptitude or apt-get to install 'python-dev'.
+As root, run this command:
+ apt-get install python-dev
+Why they do this is mysterious because:
+ - It breaks the Python model of "batteries included".
+ 'distutils' isn't an extra or optional module --
+ it's parts of the Standard Python Library.
+ - The Debian 'python-dev' package is a microscopic 50K installed.
+ So what are they saving?
+ - Distutils is not only interesting to developers. Many non-development
+ oriented Python packages use 'distutils' to install applications.
+ - As far as I can tell, the package maintainers must go through
+ more trouble to remove 'distutils' from the standard Python
+ distribution than it would take just to leave it in.
+
diff --git a/pexpect/MANIFEST b/pexpect/MANIFEST
deleted file mode 100644
index 468fa55..0000000
--- a/pexpect/MANIFEST
+++ /dev/null
@@ -1,10 +0,0 @@
-README
-LICENSE
-INSTALL
-setup.py
-pexpect.py
-fdpexpect.py
-pxssh.py
-screen.py
-ANSI.py
-FSM.py
diff --git a/pexpect/MANIFEST.in b/pexpect/MANIFEST.in
new file mode 100644
index 0000000..324e182
--- /dev/null
+++ b/pexpect/MANIFEST.in
@@ -0,0 +1,4 @@
+recursive-include doc *
+recursive-include examples *
+include README LICENSE INSTALL
+include setup.py pexpect.py fdpexpect.py pxssh.py screen.py ANSI.py FSM.py
diff --git a/pexpect/Makefile b/pexpect/Makefile
index 0453ccf..d24e9f6 100644
--- a/pexpect/Makefile
+++ b/pexpect/Makefile
@@ -4,67 +4,53 @@ VERSION=2.1
#DOCGENERATOR= happydoc
DOCGENERATOR= pydoc -w
# This is for GNU Make. This does not work on BSD Make.
-MANIFEST_LINES := $(shell cat MANIFEST)
+#MANIFEST_LINES := $(shell cat MANIFEST)
# This is for BSD Make. This does not work on GNU Make.
#MANIFEST_LINES != cat MANIFEST
-all: dist examples docs
+all: merge_templates docs dist
-# *.py README MANIFEST
+merge_templates:
+ python tools/merge_templates.py
-# I had to add the chmod 644 and 755 because cvs sucks.
-# I accidentally checked in some files with the wrong permissions
-# and now there is no way to fix those (I don't have CVSROOT access
-# becuase I'm using cvs hosted on sourceforge).
-dist/pexpect-$(VERSION).tar.gz: $(MANIFEST_LINES)
- rm -f *.pyc
- rm -f pexpect-*.tgz
- rm -f dist/pexpect-$(VERSION).tar.gz
- chmod 644 *.py
- chmod 755 setup.py
- chmod 755 examples/*.py
- /usr/bin/env python setup.py sdist
-
-dist: pexpect-current.tgz
-
-pexpect-current.tgz: dist/pexpect-$(VERSION).tar.gz
- rm -f pexpect-current.tgz
- cp dist/pexpect-$(VERSION).tar.gz ./pexpect-current.tgz
- cp dist/pexpect-$(VERSION).tar.gz ./pexpect-$(VERSION).tgz
-
-docs: pexpect-doc.tgz
-
-pexpect-doc.tgz: doc/*
- rm -f pexpect-*-doc.tgz
- -rm -f `ls doc/*.html | sed -e 's/doc\/index\.html//'`
+docs: doc/*
+# rm -f pexpect-doc-$(VERSION).tar.gz
+ -rm -f `ls doc/*.html | sed -e 's/doc\/index\.template\.html//' | sed -e 's/doc\/index\.html//'`
#$(DOCGENERATOR) `echo "$(MANIFEST_LINES)" | sed -e "s/\.py//g" -e "s/setup *//" -e "s/README *//"`
#mv *.html doc/
cd doc;\
- $(DOCGENERATOR) ../pexpect.py ../pxssh.py ../FSM.py ../ANSI.py ../screen.py;\
+ $(DOCGENERATOR) ../pexpect.py ../pxssh.py ../fdpexpect.py ../FSM.py ../screen.py ../ANSI.py;\
cd ..;\
- tar zcf pexpect-$(VERSION)-doc.tgz doc/
+# tar zcf pexpect-doc-$(VERSION).tar.gz doc/
-examples: pexpect-examples.tgz
+dist: dist/pexpect-$(VERSION).tar.gz
-pexpect-examples.tgz: examples/*
- rm -f pexpect-*-examples.tgz
- chmod 755 examples/*.py
- tar zcf pexpect-$(VERSION)-examples.tgz examples/
+# $(MANIFEST_LINES)
-clean:
+dist/pexpect-$(VERSION).tar.gz:
rm -f *.pyc
- rm -f tests/*.pyc
- rm -f tools/*.pyc
- rm -f dist/*.pyc
- rm -f *.cover
- rm -f tests/*.cover
- rm -f tools/*.cover
+ rm -f pexpect-$(VERSION).tar.gz
rm -f dist/pexpect-$(VERSION).tar.gz
- cd dist;rm -rf pexpect-$(VERSION)/
- rm -f pexpect-$(VERSION).tgz
- rm -f pexpect-$(VERSION)-examples.tgz
- rm -f pexpect-$(VERSION)-doc.tgz
- -rm -f `ls doc/*.html | sed -e 's/doc\/index\.html//'`
- rm -f python.core
- rm -f core
+ /usr/bin/env python setup.py sdist
+ cp dist/pexpect-$(VERSION).tar.gz ./pexpect-$(VERSION).tar.gz
+
+clean:
+ -rm -f MANIFEST
+ -rm -f *.pyc
+ -rm -f tests/*.pyc
+ -rm -f tools/*.pyc
+ -rm -f dist/*.pyc
+ -rm -f *.cover
+ -rm -f tests/*.cover
+ -rm -f tools/*.cover
+ -rm -f dist/pexpect-$(VERSION).tar.gz
+ -cd dist;rm -rf pexpect-$(VERSION)/
+ -rm -f pexpect-$(VERSION).tar.gz
+ -rm -f pexpect-$(VERSION)-examples.tar.gz
+ -rm -f pexpect-$(VERSION)-doc.tar.gz
+ -rm -f `ls doc/*.html | sed -e 's/doc\/index\.template\.html//'`
+ -rm -f python.core
+ -rm -f core
+ -rm -f setup.py
+ -rm -f doc/index.html
diff --git a/pexpect/examples/df.py b/pexpect/examples/df.py
index 4962db2..38115c8 100755
--- a/pexpect/examples/df.py
+++ b/pexpect/examples/df.py
@@ -4,7 +4,7 @@ Tuples of filesystem name and percentage are stored in a list.
A simple report is printed. Filesystems over 95% capacity are highlighted.
Note that this does not parse filesystem names after the first space, so
names with spaces in them will be truncated. This will produce ambiguous
-results for automount filesystems on OS X.
+results for automount filesystems on Apple OSX.
"""
import pexpect
diff --git a/pexpect/pexpect.py b/pexpect/pexpect.py
index de2f645..2f7ef98 100644
--- a/pexpect/pexpect.py
+++ b/pexpect/pexpect.py
@@ -1,32 +1,32 @@
-"""Pexpect is a Python module for spawning child applications;
-controlling them; and responding to expected patterns in their output.
-Pexpect can be used for automating interactive applications such as
-ssh, ftp, passwd, telnet, etc. It can be used to a automate setup scripts
-for duplicating software package installations on different servers.
-It can be used for automated software testing. Pexpect is in the spirit of
-Don Libes' Expect, but Pexpect is pure Python. Other Expect-like
-modules for Python require TCL and Expect or require C extensions to
-be compiled. Pexpect does not use C, Expect, or TCL extensions. It
-should work on any platform that supports the standard Python pty
-module. The Pexpect interface focuses on ease of use so that simple
-tasks are easy.
-
-There are two main interfaces to Pexpect -- the function, run() and
-the class, spawn. You can call the run() function to execute a command
-and return the output. This is a handy replacement for os.system().
+"""Pexpect is a Python module for spawning child applications and controlling
+them automatically. Pexpect can be used for automating interactive applications
+such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
+scripts for duplicating software package installations on different servers. It
+can be used for automated software testing. Pexpect is in the spirit of Don
+Libes' Expect, but Pexpect is pure Python. Other Expect-like modules for Python
+require TCL and Expect or require C extensions to be compiled. Pexpect does not
+use C, Expect, or TCL extensions. It should work on any platform that supports
+the standard Python pty module. The Pexpect interface focuses on ease of use so
+that simple tasks are easy.
+
+There are two main interfaces to Pexpect -- the function, run() and the class,
+spawn. You can call the run() function to execute a command and return the
+output. This is a handy replacement for os.system().
+
For example:
pexpect.run('ls -la')
-The more powerful interface is the spawn class. You can create an
-insteance of an external command and use spawn to interact with
-the
-You can use this to spawn an external child command and then
-interact with the child by sending lines and expecting responses.
+
+The more powerful interface is the spawn class. You can use this to spawn an
+external child command and then interact with the child by sending lines and
+expecting responses.
+
For example:
child = pexpect.spawn('scp foo myname@host.example.com:.')
child.expect ('Password:')
child.sendline (mypassword)
-This works even for commands that ask for passwords or other input
-outside of the normal stdio streams.
+
+This works even for commands that ask for passwords or other input outside of
+the normal stdio streams.
Credits:
Noah Spurrier
@@ -54,23 +54,23 @@ Credits:
Free, open source, and all that good stuff.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
Pexpect Copyright (c) 2006 Noah Spurrier
http://pexpect.sourceforge.net/
diff --git a/pexpect/setup.py.template b/pexpect/setup.py.template
index eecdded..c83468c 100644
--- a/pexpect/setup.py.template
+++ b/pexpect/setup.py.template
@@ -5,7 +5,7 @@ $Date$
from distutils.core import setup
setup (name='pexpect',
version='VERSION',
- py_modules=['pexpect', 'pxssh'],
+ py_modules=['pexpect', 'pxssh', 'fdpexpect'],
description='Pexpect is a pure Python Expect. It allows easy control of other applications.',
author='Noah Spurrier',
author_email='noah@noah.org',
diff --git a/pexpect/tools/hash.py b/pexpect/tools/hash.py
deleted file mode 100755
index 5da76e1..0000000
--- a/pexpect/tools/hash.py
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env python
-import sys
-
-lines = sys.stdin.readlines()
-for line in lines:
- sys.stdout.write ('#' + line)