Ejemplo n.º 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()])),
     )
Ejemplo n.º 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 []))))
Ejemplo n.º 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()])),
     )
Ejemplo n.º 4
0
 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()])))
Ejemplo n.º 5
0
Archivo: sets.py Proyecto: 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 []))
         )
     )
Ejemplo n.º 6
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 []))))
Ejemplo n.º 7
0
 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()])))
Ejemplo n.º 8
0
 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 []))))