def getClientSpec():
 specList = p4CmdList('client -o')
 if (len(specList) != 1):
  die(('Output from "client -o" is %d lines, expecting 1' % len(specList)))
 entry = specList[0]
 client_name = entry['Client']
 view_keys = [k for k in entry.keys() if k.startswith('View')]
 view = View(client_name)
 for view_num in range(len(view_keys)):
  k = ('View%d' % view_num)
  if (k not in view_keys):
   die(('Expected view key %s missing' % k))
  view.append(entry[k])
 return view

def getClientSpec ( ) : specList = p4CmdList ( 'client -o' ) if ( len ( specList ) != 1 ) : die ( ( 'Output from "client -o" is %d lines, expecting 1' % len ( specList ) ) ) entry = specList [ 0 ] client_name = entry [ 'Client' ] view_keys = [ k for k in entry . keys ( ) if k . startswith ( 'View' ) ] view = View ( client_name ) for view_num in range ( len ( view_keys ) ) : k = ( 'View%d' % view_num ) if ( k not in view_keys ) : die ( ( 'Expected view key %s missing' % k ) ) view . append ( entry [ k ] ) return view
look at the p4 client spec .