Instead of parsing the output of "p4 users" use the python objects of "p4 -G users".
tree61d957228d35d3e7ecaa4c400b55022730befa50
drwxr-xr-x - contrib