Ejemplo n.º 1
0
    def get_rich_attribute(self, name, default=[]):
        """Get an attribute from the title page parsed into a RichString.
        Returns a list of RichString objects.

        E.g. `screenplay.get_rich_attribute('Title')`

        """
        if name in self.title_page:
            return [parse_emphasis(line) for line in self.title_page[name]]
        else:
            return default
Ejemplo n.º 2
0
def _string_to_rich(line):
    """Converts a single string into a RichString.
    """
    return parse_emphasis(line)
Ejemplo n.º 3
0
def _sequence_to_rich(lines):
    """Converts a sequence of strings into a list of RichString."""
    return [parse_emphasis(line) for line in lines]
Ejemplo n.º 4
0
 def _create_dialog(self, character):
     return Dialog(
         parse_emphasis(character.strip()),
         _sequence_to_rich(line.strip() for line in self.lines[1:])
     )