Fixes Issue 1504, allowing feather beam line breaking.
[lilypond/patrick.git] / stepmake / bin / ntpwd.py
bloba4838b36b8356d24ca0c8d52d6fe3e72a454ca74
1 """Winnt access into /etc/passwd via account name"""
3 import sys
4 import string
6 def getpwname( name, pwfile='/etc/passwd' ):
7 "Get password record that matches the specified name"
8 try:
9 _fd = open( pwfile, 'r' )
10 except:
11 sys.stderr.write("Error unable to locate" + pwfile + "\n")
12 sys.stderr.write("Consult gnu-win32 command mkpasswd\n")
13 sys.exit(1)
15 _data = _fd.read()
16 _fd.close()
18 for _line in string.split(_data, '\n'):
19 _record=string.split( _line, ':' );
20 if _record[0] == name:
21 return _record
22 return ()
24 def _test():
25 pw = getpwname( 'jeff' )
26 print pw[4]
28 if __name__ == '__main__':
29 _test()