def memcache_get_response(response):
 if (('item' not in response) or (not response['item'])):
  return (None, 1)
 items = response['item']
 for (i, item) in enumerate(items):
  if (type(item) == dict):
   if ('MemcacheGetResponse_Item' in item):
    item = item['MemcacheGetResponse_Item']['value']
   else:
    item = item['Item']['value']
   item = truncate(repr(item))
   items[i] = item
 response_short = '\n'.join(items)
 return (response_short, 0)

def memcache_get_response ( response ) : if ( ( 'item' not in response ) or ( not response [ 'item' ] ) ) : return ( None , 1 ) items = response [ 'item' ] for ( i , item ) in enumerate ( items ) : if ( type ( item ) == dict ) : if ( 'MemcacheGetResponse_Item' in item ) : item = item [ 'MemcacheGetResponse_Item' ] [ 'value' ] else : item = item [ 'Item' ] [ 'value' ] item = truncate ( repr ( item ) ) items [ i ] = item response_short = '\n' . join ( items ) return ( response_short , 0 )
pretty-format a memcache .