Make LRF get_metadata work with either streams or LRFDocuments

This commit is contained in:
Kovid Goyal 2007-12-11 19:32:29 +00:00
parent 74a12c6598
commit 92dc7600e4

View File

@ -231,8 +231,9 @@ def get_metadata(stream):
"""
Return basic meta-data about the LRF file in C{stream} as a
L{MetaInformation} object.
@param stream: A file like object or an instance of L{LRFMetaFile}
"""
lrf = LRFMetaFile(stream)
lrf = stream if isinstance(stream, LRFMetaFile) else LRFMetaFile(stream)
au = lrf.author.strip().split(',')
authors = []
for i in au: