def parse_etags(value):
 if (not value):
  return ETags()
 strong = []
 weak = []
 end = len(value)
 pos = 0
 while (pos < end):
  match = _etag_re.match(value, pos)
  if (match is None):
   break
  (is_weak, quoted, raw) = match.groups()
  if (raw == '*'):
   return ETags(star_tag=True)
  elif quoted:
   raw = quoted
  if is_weak:
   weak.append(raw)
  else:
   strong.append(raw)
  pos = match.end()
 return ETags(strong, weak)

def parse_etags ( value ) : if ( not value ) : return ETags ( ) strong = [ ] weak = [ ] end = len ( value ) pos = 0 while ( pos < end ) : match = _etag_re . match ( value , pos ) if ( match is None ) : break ( is_weak , quoted , raw ) = match . groups ( ) if ( raw == '*' ) : return ETags ( star_tag = True ) elif quoted : raw = quoted if is_weak : weak . append ( raw ) else : strong . append ( raw ) pos = match . end ( ) return ETags ( strong , weak )
parses a string with one or several etags passed in if-none-match and if-match headers by the rules in rfc 2616 .