Changeset 762 for pykota

Show
Ignore:
Timestamp:
02/08/03 22:44:49 (22 years ago)
Author:
jalet
Message:

Python 2.1 string module doesn't define ascii_letters

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/edpykota

    r758 r762  
    1717# 
    1818# $Log$ 
     19# Revision 1.12  2003/02/08 21:44:49  jalet 
     20# Python 2.1 string module doesn't define ascii_letters 
     21# 
    1922# Revision 1.11  2003/02/08 09:42:44  jalet 
    2023# Better handle wrong or bad command line arguments 
     
    136139    def isValidPrinterName(self, printername) : 
    137140        """Checks if a printername is valid.""" 
    138         import string 
    139         if printername[0] in string.ascii_letters : 
    140             validchars = string.ascii_letters + string.digits + "-_" 
     141        # unfortunately Python 2.1 string modules doesn't define ascii_letters... 
     142        asciiletters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' 
     143        digits = '0123456789' 
     144        if printername[0] in asciiletters : 
     145            validchars = asciiletters + digits + "-_" 
    141146            for c in printername[1:] : 
    142147                if c not in validchars :