def parseResource(e): r = Resource() ETtoObject(e,r,propertiesToTags) r.name = unquote(r.name) r.category = e.get('category') if r.category == 'directory': if e.findtext('ResourceNumItems') is not None: r.numItems = int(e.findtext('ResourceNumItems')) elif e.findtext('ResourceSize') is not None: r.size = int(e.findtext('ResourceSize')) if hasattr(r,'url'): r.path = urlToPath(r.url) r.resourceDate = parseDate(e.find('ResourceDate')) return r