mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	'verbose' flag ala GvR updated test harness architecture. Old way: verbose = 0 if __name__ == '__main__': verbose = 1 New way: from test_support import verbose Some other small readablility and functionality updates.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			446 B
		
	
	
	
		
			Python
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			446 B
		
	
	
	
		
			Python
		
	
	
		
			Executable file
		
	
	
	
	
#! /usr/bin/env python
 | 
						|
"""Test script for the grp module
 | 
						|
   Roger E. Masse
 | 
						|
"""
 | 
						|
  
 | 
						|
import grp
 | 
						|
from test_support import verbose
 | 
						|
 | 
						|
groups = grp.getgrall()
 | 
						|
if verbose:
 | 
						|
    print 'Groups:'
 | 
						|
    for group in groups:
 | 
						|
	print group
 | 
						|
 | 
						|
 | 
						|
group = grp.getgrgid(groups[0][2])
 | 
						|
if verbose:
 | 
						|
    print 'Group Entry for GID %d: %s' % (groups[0][2], group)
 | 
						|
 | 
						|
group = grp.getgrnam(groups[0][0])
 | 
						|
if verbose:
 | 
						|
    print 'Group Entry for group %s: %s' % (groups[0][0], group)
 |