def unserialize_file(file_, *args, **kwargs): close = False if not isinstance(file_, file): file_ = open(file_) close = True result = unserialize(elementtree_fromstring(file_.read()), *args, **kwargs) if close: file_.close() return result
def unserialize_string(string, *args, **kwargs): return unserialize(elementtree_fromstring(string), *args, **kwargs)