def vformat_list(formatter, format_strings, args, kwargs): """Format a list of *format_srings* using *formatter*. Resulting non-empty strings are joined by a space. """ return " ".join(filter(None, (formatter.vformat(format_string, args, kwargs) for format_string in as_list(format_strings))))
def _init_implicit_inputs(self, implicit_inputs): implicit_inputs = as_list(implicit_inputs) try: val = getattr(type(self), "executable") except AttributeError: pass else: if os.path.isabs(str(val)): implicit_inputs.append(val) implicit_inputs.extend(self.extra_implicit_inputs()) self._implicit_inputs = tuple(implicit_inputs)
def test_set(self): self.assertCountEqual(as_list(set(("foo", "bar"))), ["foo", "bar"])
def test_tuple(self): self.assertEqual(as_list(("foo", "bar")), ["foo", "bar"])
def test_list(self): self.assertEqual(as_list(["foo", "bar"]), ["foo", "bar"])
def test_singleton(self): self.assertEqual(as_list("foo"), ["foo"])
def test_none(self): self.assertEqual(as_list(None), [])
def _init_orderonly_inputs(self, orderonly_inputs): orderonly_inputs = as_list(orderonly_inputs) orderonly_inputs.extend(self.extra_orderonly_inputs()) self._orderonly_inputs = tuple(orderonly_inputs)
def _init_implicit_outputs(self, implicit_outputs): implicit_outputs = as_list(implicit_outputs) implicit_outputs.extend(self.extra_implicit_outputs()) self._implicit_outputs = tuple(implicit_outputs)