ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/ccs/admin/adduser.py
Revision: 590
Committed: 2009-10-13T03:25:21-07:00 (15 years, 8 months ago) by douglas
Content type: text/x-python
Original Path: admin/chsh.py
File size: 687 byte(s)
Log Message:
Rearrange?

File Contents

# User Rev Content
1 douglas 587 #!/usr/bin/env python
2     # CCS Computer Science
3     # Change Shell
4     #
5     # Douglas Thrift
6     #
7     # $Id$
8    
9 douglas 590 import common
10 douglas 587 import re
11    
12     if __name__ == '__main__':
13     try:
14 douglas 590 shells = map(lambda shells: shells[0], common.SHELLS)
15 douglas 587 shell = None
16    
17     while shell not in shells:
18     shell = raw_input('Shell (%s): ' % ', '.join(shells))
19    
20 douglas 590 shells = dict(common.SHELLS)[shell]
21 douglas 587
22     if shell == 'custom':
23     path = re.compile('^/.*[^/]$')
24    
25 douglas 590 for system in common.SYSTEMS:
26 douglas 587 while shells[system] is None or path.match(shells[system]) is None:
27     shells[system] = raw_input((system.capitalize() if not system.endswith('bsd') else system[:-3].capitalize() + 'BSD') + ': ')
28     except (EOFError, KeyboardInterrupt):
29     pass

Properties

Name Value
svn:executable *
svn:keywords Id