ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/ccs/admin/passwd.py
Revision: 587
Committed: 2009-10-13T03:13:20-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:
Checkpoint progress before rearranging.

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     import passwd
10     import re
11    
12     if __name__ == '__main__':
13     try:
14     shells = map(lambda shells: shells[0], passwd.SHELLS)
15     shell = None
16    
17     while shell not in shells:
18     shell = raw_input('Shell (%s): ' % ', '.join(shells))
19    
20     shells = dict(passwd.SHELLS)[shell]
21    
22     if shell == 'custom':
23     path = re.compile('^/.*[^/]$')
24    
25     for system in passwd.SYSTEMS:
26     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