def _split_auth_string(auth_string):
 prev = None
 for item in auth_string.split(','):
  try:
   if (prev.count('"') == 1):
    prev = ('%s,%s' % (prev, item))
    continue
  except AttributeError:
   if (prev == None):
    prev = item
    continue
   else:
    raise StopIteration
  (yield prev.strip())
  prev = item
 (yield prev.strip())
 raise StopIteration

def _split_auth_string ( auth_string ) : prev = None for item in auth_string . split ( ',' ) : try : if ( prev . count ( '"' ) == 1 ) : prev = ( '%s,%s' % ( prev , item ) ) continue except AttributeError : if ( prev == None ) : prev = item continue else : raise StopIteration ( yield prev . strip ( ) ) prev = item ( yield prev . strip ( ) ) raise StopIteration
split a digest auth string into individual key=value strings .