@@ -1158,6 +1158,9 @@ class FrontierSlot(object):
11581158 >>> data = [{'fp': 'page1.html', 'p': 1, 'qdata': {'depth': 1}}]
11591159 >>> slot.q.add('example.com', data)
11601160
1161+ - add fingerprints to a slot
1162+ >>> slot.f.add(['fp1', 'fp2'])
1163+
11611164 - flush data for a slot
11621165 >>> slot.flush()
11631166
@@ -1168,6 +1171,12 @@ class FrontierSlot(object):
11681171 [{'id': '0115a8579633600006',
11691172 'requests': [['page1.html', {'depth': 1}]]}]
11701173
1174+ - read fingerprints from a slot
1175+ >>> slot.f.iter()
1176+ <generator object jldecode at 0x103de4938>
1177+ >>> slot.f.list()
1178+ ['page1.html']
1179+
11711180 - delete a batch with requests from a slot
11721181 >>> slot.q.delete('0115a8579633600006')
11731182
@@ -1220,14 +1229,14 @@ def add(self, fps):
12201229 writer .write ({'fp' : fp })
12211230
12221231 def iter (self , ** kwargs ):
1223- """Iterate through fingerprints."""
1232+ """Iterate through fingerprints in the slot ."""
12241233 origin = self ._frontier ._frontiers ._origin
12251234 path = (self ._frontier .key , 's' , self .key , 'f' )
12261235 for fp in origin .apiget (path , params = kwargs ):
12271236 yield fp .get ('fp' )
12281237
12291238 def list (self , ** kwargs ):
1230- """List fingerprints in slot."""
1239+ """List fingerprints in the slot."""
12311240 return list (self .iter (** kwargs ))
12321241
12331242
@@ -1239,22 +1248,22 @@ def __init__(self, slot):
12391248 self ._slot = slot
12401249
12411250 def add (self , fps ):
1242- """Add requests to slot ."""
1251+ """Add requests to the queue ."""
12431252 origin = self ._frontier ._frontiers ._origin
12441253 return origin .add (self ._frontier .key , self .key , fps )
12451254
12461255 def iter (self , ** kwargs ):
1247- """Iterate through batches in queue."""
1256+ """Iterate through batches in the queue."""
12481257 origin = self ._frontier ._frontiers ._origin
12491258 path = (self ._frontier .key , 's' , self .key , 'q' )
12501259 return origin .apiget (path , params = kwargs )
12511260
12521261 def list (self , ** kwargs ):
1253- """List request batches in slot ."""
1262+ """List request batches in the queue ."""
12541263 return list (self .iter (** kwargs ))
12551264
12561265 def delete (self , ids ):
1257- """Delete request batches from slot ."""
1266+ """Delete request batches from the queue ."""
12581267 origin = self ._frontier ._frontiers ._origin
12591268 return origin .delete (self ._frontier .key , self .key , ids )
12601269
0 commit comments