[Netdevicelib-checkins] CVS: netdevicelib/src/netdevicelib connections.py,1.10,1.11 devices.py,1.5,1
Status: Alpha
Brought to you by:
bluecoat93
|
From: <net...@li...> - 2002-06-19 22:59:44
|
Update of /cvsroot/netdevicelib/netdevicelib/src/netdevicelib
In directory usw-pr-cvs1:/tmp/cvs-serv20749/src/netdevicelib
Modified Files:
connections.py devices.py
Log Message:
- add documentation strings to modules
- add version check to require Python 2.0
- implement distutils setup.py script
Index: connections.py
===================================================================
RCS file: /cvsroot/netdevicelib/netdevicelib/src/netdevicelib/connections.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** connections.py 24 Oct 2001 18:41:58 -0000 1.10
--- connections.py 19 Jun 2002 22:59:40 -0000 1.11
***************
*** 10,18 ****
# ========================================================================
from netdevicelib.devices import DeviceFactory
- import getopt, re, sys, telnetlib, types
# ------------------------------------------------------------------------
LoginFailedException = "Login failed. Bad username or password"
EnableFailedException = "Enable failed. Access denied"
--- 10,30 ----
# ========================================================================
+ import getopt, re, string, sys, telnetlib, types
+
+ # We requre Python 2.0
+ pyversion = string.split( string.split( sys.version )[0], "." )
+
+ if map( int, pyversion ) < [2, 0, 0]:
+ sys.stderr.write( "Sorry, this library requires at least Python 2.0\n" )
+ sys.exit(1);
+
from netdevicelib.devices import DeviceFactory
# ------------------------------------------------------------------------
+ # Module documentation strings
+ __version__ = '$Revision$'.split()[-2]
+
+ # Exceptions
LoginFailedException = "Login failed. Bad username or password"
EnableFailedException = "Enable failed. Access denied"
Index: devices.py
===================================================================
RCS file: /cvsroot/netdevicelib/netdevicelib/src/netdevicelib/devices.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** devices.py 24 Oct 2001 18:42:57 -0000 1.5
--- devices.py 19 Jun 2002 22:59:41 -0000 1.6
***************
*** 10,13 ****
--- 10,29 ----
# ========================================================================
+ import string, sys
+
+ # We requre Python 2.0
+ pyversion = string.split( string.split( sys.version )[0], "." )
+
+ if map( int, pyversion ) < [2, 0, 0]:
+ sys.stderr.write( "Sorry, this library requires at least Python 2.0\n" )
+ sys.exit(1);
+
+ # ------------------------------------------------------------------------
+
+ # Module documentation strings
+ __version__ = '$Revision$'.split()[-2]
+
+ # ------------------------------------------------------------------------
+
class Device:
def __init__( self ):
|