Changeset 764 for pykota/trunk
- Timestamp:
- 02/08/03 23:09:52 (22 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r742 r764 15 15 # 16 16 # $Log$ 17 # Revision 1.15 2003/02/08 22:09:52 jalet 18 # Name check method moved here 19 # 17 20 # Revision 1.14 2003/02/07 10:42:45 jalet 18 21 # Indentation problem … … 164 167 return (parsed, args) 165 168 169 def isValidName(self, name) : 170 """Checks if a user or printer name is valid.""" 171 # unfortunately Python 2.1 string modules doesn't define ascii_letters... 172 asciiletters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' 173 digits = '0123456789' 174 if name[0] in asciiletters : 175 validchars = asciiletters + digits + "-_" 176 for c in name[1:] : 177 if c not in validchars : 178 return 0 179 return 1 180 return 0 181 166 182 def sendMessage(self, touser, fullmessage) : 167 183 """Sends an email message containing headers to some user."""