def image_meta_to_http_headers(image_meta):
 headers = {}
 for (k, v) in image_meta.items():
  if (v is not None):
   if (k == 'properties'):
    for (pk, pv) in v.items():
     if (pv is not None):
      headers[('x-image-meta-property-%s' % pk.lower())] = unicode(pv)
   else:
    headers[('x-image-meta-%s' % k.lower())] = unicode(v)
 return headers

def image_meta_to_http_headers ( image_meta ) : headers = { } for ( k , v ) in image_meta . items ( ) : if ( v is not None ) : if ( k == 'properties' ) : for ( pk , pv ) in v . items ( ) : if ( pv is not None ) : headers [ ( 'x-image-meta-property-%s' % pk . lower ( ) ) ] = unicode ( pv ) else : headers [ ( 'x-image-meta-%s' % k . lower ( ) ) ] = unicode ( v ) return headers
returns a set of image metadata into a dict of http headers that can be fed to either a webob request object or an httplib .