From 0b428eb5d5ceefdb178843db3e12072457fb7aec Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 20 Oct 2012 02:19:33 +0000 Subject: Mostly a massive license update. Added a license per file. git-svn-id: http://pexpect.svn.sourceforge.net/svnroot/pexpect/trunk@533 656d521f-e311-0410-88e0-e7920216d269 --- pexpect/examples/hive.py | 53 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 12 deletions(-) (limited to 'pexpect/examples/hive.py') diff --git a/pexpect/examples/hive.py b/pexpect/examples/hive.py index f2416a3..ad9ce39 100755 --- a/pexpect/examples/hive.py +++ b/pexpect/examples/hive.py @@ -58,24 +58,53 @@ on your machine can see this auth information. This is not secure. This is a crude script that begs to be multithreaded. But it serves its purpose. -Noah Spurrier +PEXPECT LICENSE + + This license is approved by the OSI and FSF as GPL-compatible. + http://opensource.org/licenses/isc-license.txt + + Copyright (c) 2012, Noah Spurrier + PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY + PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE + COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -$Id$ """ # TODO add feature to support username:password@host combination # TODO add feature to log each host output in separate file -import sys, os, re, optparse, traceback, types, time, getpass -import pexpect, pxssh -import readline, atexit - -#histfile = os.path.join(os.environ["HOME"], ".hive_history") -#try: -# readline.read_history_file(histfile) -#except IOError: -# pass -#atexit.register(readline.write_history_file, histfile) +import sys +import os +import re +import optparse +import traceback +import types +import time +import getpass +import readline +import atexit +try: + import pexpect + import pxssh +except ImportError: + sys.stderr.write("You do not have 'pexpect' installed.\n") + sys.stderr.write("On Ubuntu you need the 'python-pexpect' package.\n") + sys.stderr.write(" aptitude -y install python-pexpect\n") + exit(1) + +histfile = os.path.join(os.environ["HOME"], ".hive_history") +try: + readline.read_history_file(histfile) +except IOError: + pass +atexit.register(readline.write_history_file, histfile) CMD_HELP="""Hive commands are preceded by a colon : (just think of vi). -- cgit v1.2.1