Commits

Jason R. Coombs  committed 9d4af0f

Fleshed out Writer.add_reader with my guess at what it might be supposed to be doing.

  • Participants
  • Parent commits d062ca1

Comments (0)

Files changed (1)

File thwump/writing.py

 	def add_document(self, **fields):
 		self.index.collection.insert(fields)
 
-	def add_reader(self):
-		raise NotImplementedError("stubbed")
+	def add_reader(self, reader):
+		"""
+		Add the documents from the reader to the writer (?). Parent class
+		doesn't document what this is supposed to do.
+		Return None
+		"""
+		for item in reader.index.collection.find():
+			self.index.insert(item)
 
 	def delete_document(self, docnum, delete=True):
 		self.index.collection.remove(docnum)