8 print >> sys.stderr, "Usage: id-other-than <--user|--group> ID [ID ...]"
21 excluded_ids = set(int(x) for x in sys.argv[2:] if is_integer(x))
22 excluded_names = (x for x in sys.argv[2:] if not is_integer(x))
24 if sys.argv[1] == '--user':
25 for x in excluded_names:
26 excluded_ids.add(pwd.getpwnam(x).pw_uid)
27 for x in pwd.getpwall():
28 if x.pw_uid not in excluded_ids:
29 print x.pw_name + ':' + str(x.pw_uid)
31 elif sys.argv[1] == '--group':
32 for x in excluded_names:
33 excluded_ids.add(grp.getgrnam(x).gr_gid)
34 for x in grp.getgrall():
35 if x.gr_gid not in excluded_ids:
36 print x.gr_name + ':' + str(x.gr_gid)