Class property that returns a populated template string This property allows the template of a particular process to be dynamically generated and returned when doing ``Process.template_str``. Returns ------- x : str String with the complete and p
(self)
| 418 | |
| 419 | @property |
| 420 | def template_str(self): |
| 421 | """Class property that returns a populated template string |
| 422 | |
| 423 | This property allows the template of a particular process to be |
| 424 | dynamically generated and returned when doing ``Process.template_str``. |
| 425 | |
| 426 | Returns |
| 427 | ------- |
| 428 | x : str |
| 429 | String with the complete and populated process template |
| 430 | |
| 431 | """ |
| 432 | |
| 433 | if not self._context: |
| 434 | raise eh.ProcessError("Channels must be setup first using the " |
| 435 | "set_channels method") |
| 436 | |
| 437 | logger.debug("Setting context for template {}: {}".format( |
| 438 | self.template, self._context |
| 439 | )) |
| 440 | |
| 441 | x = self.render(self._template_path, self._context) |
| 442 | return x |
| 443 | |
| 444 | def set_channels(self, **kwargs): |
| 445 | """ General purpose method that sets the main channels |