def override_bytes_from_content_type(listing_dict, logger=None):
 (listing_dict['content_type'], swift_bytes) = extract_swift_bytes(listing_dict['content_type'])
 if (swift_bytes is not None):
  try:
   listing_dict['bytes'] = int(swift_bytes)
  except ValueError:
   if logger:
    logger.exception(_('Invalid swift_bytes'))

def override_bytes_from_content_type ( listing_dict , logger = None ) : ( listing_dict [ 'content_type' ] , swift_bytes ) = extract_swift_bytes ( listing_dict [ 'content_type' ] ) if ( swift_bytes is not None ) : try : listing_dict [ 'bytes' ] = int ( swift_bytes ) except ValueError : if logger : logger . exception ( _ ( 'Invalid swift_bytes' ) )
takes a dict from a container listing and overrides the content_type .