def AnyEntryFromString(xml_string):
 tree = ElementTree.fromstring(xml_string)
 category = tree.find(('{%s}category' % atom.ATOM_NAMESPACE))
 if (category is None):
  return atom._CreateClassFromElementTree(GPhotosBaseEntry, tree)
 (namespace, kind) = category.get('term').split('#')
 if (namespace != PHOTOS_NAMESPACE):
  return atom._CreateClassFromElementTree(GPhotosBaseEntry, tree)
 feed_class = getattr(gdata.photos, ('%sEntry' % kind.title()))
 return atom._CreateClassFromElementTree(feed_class, tree)

def AnyEntryFromString ( xml_string ) : tree = ElementTree . fromstring ( xml_string ) category = tree . find ( ( '{%s}category' % atom . ATOM_NAMESPACE ) ) if ( category is None ) : return atom . _CreateClassFromElementTree ( GPhotosBaseEntry , tree ) ( namespace , kind ) = category . get ( 'term' ) . split ( '#' ) if ( namespace != PHOTOS_NAMESPACE ) : return atom . _CreateClassFromElementTree ( GPhotosBaseEntry , tree ) feed_class = getattr ( gdata . photos , ( '%sEntry' % kind . title ( ) ) ) return atom . _CreateClassFromElementTree ( feed_class , tree )
creates an instance of the appropriate entry class from the xml string contents .