old_contents: from types import UnicodeType, StringType
  
  class PropertyMappingFailedException(Exception):
      pass
  
  def get_transformed_properties(source_properties, prop_map):
      results = {}
      for key, value in prop_map.iteritems():
          if type(value) in (StringType, UnicodeType):
              if value in source_properties:
                  results[key] = source_properties[value]
              else:
                  raise PropertyMappingFailedException("property %s not found in source feature" % 
                      (value))
          elif type(value) == dict:
              if "static" in value:
                  results[key] = value["static"]
              else:
                  raise PropertyMappingFailedException(
                      "Failed to find key for mapping in dict for field:%s" % 
                      (key,))
          else:
              raise PropertyMappingFailedException("Unhandled mapping for key:%s value type:%s" % 
                  (key, type(value)))
      return results
  
new_contents: from types import UnicodeType, StringType
  
  class PropertyMappingFailedException(Exception):
      pass
  
  def get_transformed_properties(source_properties, prop_map):
      results = {}
      for key, value in prop_map.iteritems():
          if type(value) in (StringType, UnicodeType):
              if value in source_properties:
                  results[key] = source_properties[value]
              else:
                  raise PropertyMappingFailedException("property %s not found in source feature" % 
                      (value))
          elif type(value) == dict:
              if "static" in value:
                  results[key] = value["static"]
              elif "mapping" in value:
                  if not "key" in value:
                      raise PropertyMappingFailedException(
                          "Found mapping, but no key specified to map")
                  source_value = source_properties[value['key']]
                  results[key] = value['mapping'][source_value]
              else:
                  raise PropertyMappingFailedException(
                      "Failed to find key for mapping in dict for field:%s" % 
                      (key,))
          else:
              raise PropertyMappingFailedException("Unhandled mapping for key:%s value type:%s" % 
                  (key, type(value)))
      return results
  
subject: implement dictionary based property mapping (#31)