예제 #1
0
 def items(self):
     """Flattens the data in all of the buckets into a single list."""
     # for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)]
     # zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8]
     return filter(None, chain_from_iterable(
         zip_longest(*[bucket.items for bucket in self.buckets.values()])),
     )
예제 #2
0
 def flatten_links(self):
     return list(
         chain_from_iterable(
             _chain(
                 [[self]],
                 (link.flatten_links()
                  for link in maybe_list(self.options.get("link")) or []))))
예제 #3
0
 def items(self):
     """Flattens the data in all of the buckets into a single list."""
     # for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)]
     # zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8]
     return filter(None, chain_from_iterable(
         zip_longest(*[bucket.items for bucket in self.buckets.values()])),
     )
예제 #4
0
파일: buckets.py 프로젝트: jokar/minion
 def items(self):
     # for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)]
     # zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8]
     return filter(
         None,
         chain_from_iterable(
             izip_longest(
                 *[bucket.items for bucket in self.buckets.values()])))
예제 #5
0
파일: sets.py 프로젝트: psnj/celery
 def flatten_links(self):
     """Gives a recursive list of dependencies (unchain if you will,
     but with links intact)."""
     return list(
         chain_from_iterable(
             _chain([[self]], (link.flatten_links() for link in maybe_list(self.options.get("link")) or []))
         )
     )
예제 #6
0
파일: canvas.py 프로젝트: aliscott/celery
 def flatten_links(self):
     return list(chain_from_iterable(_chain([[self]],
             (link.flatten_links()
                 for link in maybe_list(self.options.get('link')) or []))))
예제 #7
0
파일: buckets.py 프로젝트: berg/celery
 def items(self):
     # for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)]
     # zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8]
     return filter(None, chain_from_iterable(izip_longest(*[bucket.items
                                 for bucket in self.buckets.values()])))
예제 #8
0
파일: canvas.py 프로젝트: c0ns0le/zenoss-4
 def flatten_links(self):
     """Gives a recursive list of dependencies (unchain if you will,
     but with links intact)."""
     return list(chain_from_iterable(_chain([[self]],
             (link.flatten_links()
                 for link in maybe_list(self.options.get("link")) or []))))