Пример #1
0
 def test_padlist(self):
     self.assertListEqual(utils.padlist(["George", "Costanza", "NYC"], 3),
             ["George", "Costanza", "NYC"])
     self.assertListEqual(utils.padlist(["George", "Costanza"], 3),
             ["George", "Costanza", None])
     self.assertListEqual(utils.padlist(["George", "Costanza", "NYC"], 4,
                                        default="Earth"),
             ["George", "Costanza", "NYC", "Earth"])
Пример #2
0
 def test_padlist(self):
     self.assertListEqual(utils.padlist(["George", "Costanza", "NYC"], 3),
                          ["George", "Costanza", "NYC"])
     self.assertListEqual(utils.padlist(["George", "Costanza"], 3),
                          ["George", "Costanza", None])
     self.assertListEqual(
         utils.padlist(["George", "Costanza", "NYC"], 4, default="Earth"),
         ["George", "Costanza", "NYC", "Earth"])
Пример #3
0
 def format_signature(self):
     return " ".join(self.format_arg(*padlist(list(arg), 3))
                         for arg in self.args)
Пример #4
0
 def format_signature(self):
     return " ".join(self.format_arg(*padlist(list(arg), 3))
                         for arg in self.args)
Пример #5
0
 def apply_part(self, arglist, taskset_id, publisher):
     args, kwargs, opts = padlist(arglist, 3, default={})
     return apply_async(self.task, args, kwargs,
                        taskset_id=taskset_id, publisher=publisher, **opts)
Пример #6
0
 def apply_part(self, arglist, taskset_id, publisher):
     """Apply a single part of the taskset."""
     args, kwargs, opts = padlist(arglist, 3, default={})
     return apply_async(self.task, args, kwargs,
                        taskset_id=taskset_id, publisher=publisher, **opts)