Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-screenplain for 
openSUSE:Factory checked in at 2023-03-21 17:42:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-screenplain (Old)
 and      /work/SRC/openSUSE:Factory/.python-screenplain.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-screenplain"

Tue Mar 21 17:42:12 2023 rev:4 rq:1073282 version:0.9.0+git.1679319196.353e6c9

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-screenplain/python-screenplain.changes    
2022-10-06 07:42:48.088767101 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-screenplain.new.31432/python-screenplain.changes
 2023-03-21 17:42:13.754031487 +0100
@@ -1,0 +2,16 @@
+Mon Mar 20 13:44:17 UTC 2023 - [email protected]
+
+- Update to version 0.9.0+git.1679319196.353e6c9:
+  * Package tests as well.
+  * Add test for issue #65, which passes
+  * readme: PDF is supported now
+  * Add Python 3.11 to testing matrix
+  * Add test for forcing action with "!"
+  * Fix runtime error in pdf output of dual dialog
+  * Possible to force action by starting line with !
+  * pdf Settings object for styles and layout
+  * Replace nose with pytest
+  * assertEquals is deprecated - use assertEqual
+  * Remove unittest2 (Python 2 compatibility)
+
+-------------------------------------------------------------------

Old:
----
  screenplain-0.9.0+git.1597423678.4e34d1f.tar.gz

New:
----
  screenplain-0.9.0+git.1679319196.353e6c9.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-screenplain.spec ++++++
--- /var/tmp/diff_new_pack.ZfeydJ/_old  2023-03-21 17:42:15.378039255 +0100
+++ /var/tmp/diff_new_pack.ZfeydJ/_new  2023-03-21 17:42:15.386039293 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-screenplain
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,9 +21,8 @@
 %else
 %bcond_without python2
 %endif
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-screenplain
-Version:        0.9.0+git.1597423678.4e34d1f
+Version:        0.9.0+git.1679319196.353e6c9
 Release:        0
 Summary:        Convert text file to viewable screenplay
 License:        MIT
@@ -89,6 +88,7 @@
 
 %files %{python_files}
 %python_alternative %{_bindir}/screenplain
-%{python_sitelib}/*
+%{python_sitelib}/screenplain
+%{python_sitelib}/screenplain-0.9.0*-info
 
 %changelog

++++++ _service ++++++
--- /var/tmp/diff_new_pack.ZfeydJ/_old  2023-03-21 17:42:15.418039446 +0100
+++ /var/tmp/diff_new_pack.ZfeydJ/_new  2023-03-21 17:42:15.422039465 +0100
@@ -1,8 +1,8 @@
 <services>
   <service name="tar_scm" mode="disabled">
     <param name="versionprefix">0.9.0+git</param>
-    <!-- param name="url">https://github.com/vilcans/screenplain.git</param -->
-    <param name="url">https://github.com/mcepl/screenplain.git</param>
+    <!-- param name="url">https://github.com/vilcans/screenplain.git</param-->
+    <param name="url">https://git.sr.ht/~mcepl/screenplain</param>
     <param name="revision">cleanup-testing</param>
     <param name="scm">git</param>
     <param name="exclude">.git*</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.ZfeydJ/_old  2023-03-21 17:42:15.442039561 +0100
+++ /var/tmp/diff_new_pack.ZfeydJ/_new  2023-03-21 17:42:15.446039580 +0100
@@ -1,6 +1,10 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/mcepl/screenplain.git</param>
-              <param 
name="changesrevision">4e34d1f78f6006d40933d744e61ae968f349f95d</param></service></servicedata>
+              <param 
name="changesrevision">4e34d1f78f6006d40933d744e61ae968f349f95d</param></service><service
 name="tar_scm">
+                <param name="url">https://git.sr.ht/~mcepl/screenplay</param>
+              <param 
name="changesrevision">302bfdd3362f4287a471cff80908e018bc09f990</param></service><service
 name="tar_scm">
+                <param name="url">https://git.sr.ht/~mcepl/screenplain</param>
+              <param 
name="changesrevision">353e6c94e996055880c07a3846cb51b98e19dfa2</param></service></servicedata>
 (No newline at EOF)
 

++++++ screenplain-0.9.0+git.1597423678.4e34d1f.tar.gz -> 
screenplain-0.9.0+git.1679319196.353e6c9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/screenplain-0.9.0+git.1597423678.4e34d1f/.travis.yml 
new/screenplain-0.9.0+git.1679319196.353e6c9/.travis.yml
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/.travis.yml    2020-08-14 
18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/.travis.yml    2023-03-20 
14:33:16.000000000 +0100
@@ -1,11 +1,8 @@
 language: python
 python:
-  - "2.7"
   - "3.5"
   - "3.6"
   - "3.7"
   - "3.8"
 install: pip install -r requirements.txt
-script:
-    - python -munittest discover -v -p '*test*.py'
-    - python -mdoctest -v screenplain/*.py
+script: bin/test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/screenplain-0.9.0+git.1597423678.4e34d1f/README.md 
new/screenplain-0.9.0+git.1679319196.353e6c9/README.md
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/README.md      2020-08-14 
18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/README.md      2023-03-20 
14:33:16.000000000 +0100
@@ -21,8 +21,7 @@
 The magic that Screenplain performs is to take your plain text file and
 convert it to a good looking screenplay in an industry standard format.
 Send that file off to your producer, agent, director or screenwriting
-competition. Currently, the supported output formats are FDX and HTML.
-PDF will hopefully be supported in a not too distant future.
+competition. The supported output formats are FDX  HTML, and PDF.
 
 Screenplain can be used as a command-line application or a library.
 An [Online version of Screenplain](http://www.screenplain.com) is also
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/screenplain-0.9.0+git.1597423678.4e34d1f/bin/test 
new/screenplain-0.9.0+git.1679319196.353e6c9/bin/test
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/bin/test       1970-01-01 
01:00:00.000000000 +0100
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/bin/test       2023-03-20 
14:33:16.000000000 +0100
@@ -0,0 +1,3 @@
+#!/bin/bash -e
+pytest --doctest-modules
+pycodestyle --ignore=E402,W504 screenplain tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/bin/test.bat 
new/screenplain-0.9.0+git.1679319196.353e6c9/bin/test.bat
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/bin/test.bat   1970-01-01 
01:00:00.000000000 +0100
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/bin/test.bat   2023-03-20 
14:33:16.000000000 +0100
@@ -0,0 +1,2 @@
+nosetests --nocapture --with-doctest --doctest-tests
+pycodestyle --ignore=E402,W504 screenplain tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/requirements.txt 
new/screenplain-0.9.0+git.1679319196.353e6c9/requirements.txt
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/requirements.txt       
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/requirements.txt       
2023-03-20 14:33:16.000000000 +0100
@@ -1,2 +1,3 @@
 reportlab
+pytest
 pycodestyle
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/screenplain-0.9.0+git.1597423678.4e34d1f/run_tests 
new/screenplain-0.9.0+git.1679319196.353e6c9/run_tests
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/run_tests      2020-08-14 
18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/run_tests      1970-01-01 
01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-#!/bin/sh
-set -e
-
-python3 -munittest discover -v -p '*test*.py'
-python3 -mdoctest -v screenplain/*.py
-
-pycodestyle --ignore=E402,W504 screenplain tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/export/pdf.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/export/pdf.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/export/pdf.py      
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/export/pdf.py      
2023-03-20 14:33:16.000000000 +0100
@@ -2,6 +2,23 @@
 # Licensed under the MIT license:
 # http://www.opensource.org/licenses/mit-license.php
 
+from screenplain import types
+from screenplain.types import (
+    Action, Dialog, DualDialog, Transition, Slug
+)
+from reportlab.lib.enums import TA_CENTER, TA_RIGHT
+from reportlab.lib.styles import ParagraphStyle
+from reportlab.lib.units import inch
+from reportlab import platypus
+from reportlab.platypus import (
+    BaseDocTemplate,
+    Paragraph,
+    Frame,
+    PageTemplate,
+    NextPageTemplate,
+    Spacer,
+)
+from reportlab.lib import pagesizes
 import sys
 
 try:
@@ -11,114 +28,164 @@
     raise
 del reportlab
 
-from reportlab.lib import pagesizes
-from reportlab.platypus import (
-    BaseDocTemplate,
-    Paragraph,
-    Frame,
-    PageTemplate,
-    Spacer,
-)
-from reportlab import platypus
-from reportlab.lib.units import inch
-from reportlab.lib.styles import ParagraphStyle
-from reportlab.lib.enums import TA_CENTER, TA_RIGHT
 
-from screenplain.types import (
-    Action, Dialog, DualDialog, Transition, Slug
-)
-from screenplain import types
+def create_default_settings():
+    return Settings()
 
-font_size = 12
-line_height = 12
-lines_per_page = 55
-characters_per_line = 61
-character_width = 1.0 / 10 * inch  # Courier pitch is 10 chars/inch
-frame_height = line_height * lines_per_page
-frame_width = characters_per_line * character_width
-
-page_width, page_height = pagesizes.letter
-left_margin = 1.5 * inch
-right_margin = page_width - left_margin - frame_width
-top_margin = 1 * inch
-bottom_margin = page_height - top_margin - frame_height
-
-
-default_style = ParagraphStyle(
-    'default',
-    fontName='Courier',
-    fontSize=font_size,
-    leading=line_height,
-    spaceBefore=0,
-    spaceAfter=0,
-    leftIndent=0,
-    rightIndent=0,
-)
-centered_style = ParagraphStyle(
-    'default-centered', default_style,
-    alignment=TA_CENTER,
-)
 
-# Screenplay styles
-character_style = ParagraphStyle(
-    'character', default_style,
-    spaceBefore=line_height,
-    leftIndent=19 * character_width,
-    keepWithNext=1,
-)
-dialog_style = ParagraphStyle(
-    'dialog', default_style,
-    leftIndent=9 * character_width,
-    rightIndent=frame_width - (45 * character_width),
-)
-parenthentical_style = ParagraphStyle(
-    'parenthentical', default_style,
-    leftIndent=13 * character_width,
-    keepWithNext=1,
-)
-action_style = ParagraphStyle(
-    'action', default_style,
-    spaceBefore=line_height,
-)
-centered_action_style = ParagraphStyle(
-    'centered-action', action_style,
-    alignment=TA_CENTER,
-)
-slug_style = ParagraphStyle(
-    'slug', default_style,
-    spaceBefore=line_height,
-    spaceAfter=line_height,
-    keepWithNext=1,
-)
-transition_style = ParagraphStyle(
-    'transition', default_style,
-    spaceBefore=line_height,
-    spaceAfter=line_height,
-    alignment=TA_RIGHT,
-)
+class Settings:
+    # General styles
+    default_style: ParagraphStyle
+    centered_style: ParagraphStyle
+
+    # Screenplay styles
+    character_style: ParagraphStyle
+    dialog_style: ParagraphStyle
+    parenthentical_style: ParagraphStyle
+    action_style: ParagraphStyle
+    centered_action_style: ParagraphStyle
+    slug_style: ParagraphStyle
+    transition_style: ParagraphStyle
+
+    # Title page styles
+    title_style: ParagraphStyle
+    contact_style: ParagraphStyle
+
+    font_size: int
+    line_height: int
+    character_width: float
+    lines_per_page: int
+    characters_per_line: int
+
+    # True if sluglines should be bold
+    strong_slugs: bool
+
+    frame_height: float
+    frame_width: float
+    page_width: float
+    page_height: float
+
+    def __init__(
+        self,
+        font_size=12,
+        line_height=None,
+        lines_per_page=55,
+        characters_per_line=61,
+        page_size=pagesizes.letter,
+        strong_slugs=False,
+    ):
+        line_height = line_height or font_size
+
+        self.font_size = font_size
+        self.line_height = line_height
+        # Courier pitch is 10 chars/inch
+        self.character_width = 1.0 / 10 * inch
+        self.lines_per_page = lines_per_page
+        self.characters_per_line = characters_per_line
+        self.frame_height = self.line_height * self.lines_per_page
+        self.frame_width = self.characters_per_line * self.character_width
+        [self.page_width, self.page_height] = page_size
+        self.left_margin = 1.5 * inch
+        self.right_margin = self.page_width - (
+            self.left_margin + self.frame_width
+        )
+        self.top_margin = 1 * inch
+        self.bottom_margin = self.page_height - (
+            self.top_margin + self.frame_height
+        )
+        self.title_frame_width = self.page_width - (
+            self.left_margin + self.left_margin
+        )
+        self.strong_slugs = strong_slugs
 
-# Title page styles
-title_style = ParagraphStyle(
-    'title', default_style,
-    fontSize=24, leading=36,
-    alignment=TA_CENTER,
-)
-contact_style = ParagraphStyle(
-    'contact', default_style,
-    leftIndent=3.9 * inch,
-    rightIndent=0,
-)
+        default_style = ParagraphStyle(
+            'default',
+            fontName='Courier',
+            fontSize=font_size,
+            leading=line_height,
+            spaceBefore=0,
+            spaceAfter=0,
+            leftIndent=0,
+            rightIndent=0,
+        )
+        self.default_style = default_style
+
+        self.centered_style = ParagraphStyle(
+            'default-centered', self.default_style,
+            alignment=TA_CENTER,
+        )
+
+        self.character_style = ParagraphStyle(
+            'character', default_style,
+            spaceBefore=line_height,
+            leftIndent=19 * self.character_width,
+            keepWithNext=1,
+        )
+        self.dialog_style = ParagraphStyle(
+            'dialog', default_style,
+            leftIndent=9 * self.character_width,
+            rightIndent=self.frame_width - (45 * self.character_width),
+        )
+        self.parenthentical_style = ParagraphStyle(
+            'parenthentical', default_style,
+            leftIndent=13 * self.character_width,
+            keepWithNext=1,
+        )
+        self.action_style = ParagraphStyle(
+            'action', default_style,
+            spaceBefore=line_height,
+        )
+        self.centered_action_style = ParagraphStyle(
+            'centered-action', self.action_style,
+            alignment=TA_CENTER,
+        )
+        self.slug_style = ParagraphStyle(
+            'slug', default_style,
+            spaceBefore=line_height,
+            spaceAfter=line_height,
+            keepWithNext=1,
+        )
+        self.transition_style = ParagraphStyle(
+            'transition', default_style,
+            spaceBefore=line_height,
+            spaceAfter=line_height,
+            alignment=TA_RIGHT,
+        )
+
+        self.title_style = ParagraphStyle(
+            'title', default_style,
+            fontSize=font_size * 2, leading=font_size * 3,
+            alignment=TA_CENTER,
+        )
+        self.contact_style = ParagraphStyle(
+            'contact', default_style,
+        )
 
 
 class DocTemplate(BaseDocTemplate):
     def __init__(self, *args, **kwargs):
+        self.settings = (
+            kwargs.pop('settings', None) or create_default_settings()
+        )
         self.has_title_page = kwargs.pop('has_title_page', False)
         frame = Frame(
-            left_margin, bottom_margin, frame_width, frame_height,
+            self.settings.left_margin,
+            self.settings.bottom_margin,
+            self.settings.frame_width,
+            self.settings.frame_height,
             id='normal',
             leftPadding=0, topPadding=0, rightPadding=0, bottomPadding=0
         )
+        title_frame = Frame(
+            self.settings.left_margin,
+            self.settings.bottom_margin,
+            self.settings.title_frame_width,
+            self.settings.frame_height,
+            id='title',
+            leftPadding=0, topPadding=0, rightPadding=0, bottomPadding=0
+        )
         pageTemplates = [
+            PageTemplate(id='title', frames=[title_frame]),
             PageTemplate(id='standard', frames=[frame])
         ]
         BaseDocTemplate.__init__(
@@ -126,15 +193,18 @@
         )
 
     def handle_pageBegin(self):
-        self.canv.setFont('Courier', font_size, leading=line_height)
+        self.canv.setFont(
+            'Courier', self.settings.font_size,
+            leading=self.settings.line_height
+        )
         if self.has_title_page:
             page = self.page  # self.page is 0 on first page
         else:
             page = self.page + 1
         if page >= 2:
             self.canv.drawRightString(
-                left_margin + frame_width,
-                page_height - 42,
+                self.settings.left_margin + self.settings.frame_width,
+                self.settings.page_height - 42,
                 '%s.' % page
             )
         self._handle_pageBegin()
@@ -156,22 +226,28 @@
         story.append(Paragraph(html, style))
 
 
-def add_dialog(story, dialog):
-    story.append(Paragraph(dialog.character.to_html(), character_style))
+def add_dialog(story, dialog, settings: Settings):
+    story.append(
+        Paragraph(dialog.character.to_html(), settings.character_style)
+    )
     for parenthetical, line in dialog.blocks:
         if parenthetical:
-            story.append(Paragraph(line.to_html(), parenthentical_style))
+            story.append(
+                Paragraph(line.to_html(), settings.parenthentical_style)
+            )
         else:
-            story.append(Paragraph(line.to_html(), dialog_style))
+            story.append(
+                Paragraph(line.to_html(), settings.dialog_style)
+            )
 
 
-def add_dual_dialog(story, dual):
+def add_dual_dialog(story, dual, settings: Settings):
     # TODO: format dual dialog
-    add_dialog(story, dual.left)
-    add_dialog(story, dual.right)
+    add_dialog(story, dual.left, settings)
+    add_dialog(story, dual.right, settings)
 
 
-def get_title_page_story(screenplay):
+def get_title_page_story(screenplay, settings):
     """Get Platypus flowables for the title page
 
     """
@@ -187,36 +263,47 @@
             return 0
 
         if space_before:
-            story.append(Spacer(frame_width, space_before))
+            story.append(Spacer(settings.frame_width, space_before))
 
         total_height = 0
         for line in lines:
             html = line.to_html()
             para = Paragraph(html, style)
-            width, height = para.wrap(frame_width, frame_height)
+            width, height = para.wrap(
+                settings.frame_width, settings.frame_height
+            )
             story.append(para)
             total_height += height
         return space_before + total_height
 
     title_story = []
     title_height = sum((
-        add_lines(title_story, 'Title', title_style),
+        add_lines(title_story, 'Title', settings.title_style),
         add_lines(
-            title_story, 'Credit', centered_style, space_before=line_height
+            title_story,
+            'Credit',
+            settings.centered_style,
+            space_before=settings.line_height
         ),
-        add_lines(title_story, 'Author', centered_style),
-        add_lines(title_story, 'Authors', centered_style),
-        add_lines(title_story, 'Source', centered_style),
+        add_lines(title_story, 'Author', settings.centered_style),
+        add_lines(title_story, 'Authors', settings.centered_style),
+        add_lines(title_story, 'Source', settings.centered_style),
     ))
 
     lower_story = []
     lower_height = sum((
-        add_lines(lower_story, 'Draft date', default_style),
+        add_lines(lower_story, 'Draft date', settings.default_style),
         add_lines(
-            lower_story, 'Contact', contact_style, space_before=line_height
+            lower_story,
+            'Contact',
+            settings.contact_style,
+            space_before=settings.line_height
         ),
         add_lines(
-            lower_story, 'Copyright', centered_style, space_before=line_height
+            lower_story,
+            'Copyright',
+            settings.centered_style,
+            space_before=settings.line_height
         ),
     ))
 
@@ -225,18 +312,22 @@
 
     story = []
     top_space = min(
-        frame_height / 3.0,
-        frame_height - lower_height - title_height
+        settings.frame_height / 3.0,
+        settings.frame_height - lower_height - title_height
     )
     if top_space > 0:
-        story.append(Spacer(frame_width, top_space))
+        story.append(Spacer(settings.frame_width, top_space))
     story += title_story
-    # The minus 6 adds some room for rounding errors and whatnot
-    middle_space = frame_height - top_space - title_height - lower_height - 6
+    # The minus half font size adds some room for rounding errors and whatnot
+    middle_space = settings.frame_height - (
+        top_space + title_height + lower_height + settings.font_size / 2
+    )
     if middle_space > 0:
-        story.append(Spacer(frame_width, middle_space))
+        story.append(Spacer(settings.frame_width, middle_space))
     story += lower_story
 
+    story.append(NextPageTemplate('standard'))
+
     story.append(platypus.PageBreak())
     return story
 
@@ -244,25 +335,28 @@
 def to_pdf(
     screenplay, output_filename,
     template_constructor=DocTemplate,
-    is_strong=False,
+    settings=None
 ):
-    story = get_title_page_story(screenplay)
+    settings = settings or create_default_settings()
+    story = get_title_page_story(screenplay, settings)
     has_title_page = bool(story)
 
     for para in screenplay:
         if isinstance(para, Dialog):
-            add_dialog(story, para)
+            add_dialog(story, para, settings)
         elif isinstance(para, DualDialog):
-            add_dual_dialog(story, para)
+            add_dual_dialog(story, para, settings)
         elif isinstance(para, Action):
             add_paragraph(
                 story, para,
-                centered_action_style if para.centered else action_style
+                settings.centered_action_style
+                if para.centered
+                else settings.action_style
             )
         elif isinstance(para, Slug):
-            add_slug(story, para, slug_style, is_strong)
+            add_slug(story, para, settings.slug_style, settings.strong_slugs)
         elif isinstance(para, Transition):
-            add_paragraph(story, para, transition_style)
+            add_paragraph(story, para, settings.transition_style)
         elif isinstance(para, types.PageBreak):
             story.append(platypus.PageBreak())
         else:
@@ -271,7 +365,8 @@
 
     doc = template_constructor(
         output_filename,
-        pagesize=(page_width, page_height),
+        pagesize=(settings.page_width, settings.page_height),
+        settings=settings,
         has_title_page=has_title_page
     )
     doc.build(story)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/main.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/main.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/main.py    
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/main.py    
2023-03-20 14:33:16.000000000 +0100
@@ -94,7 +94,7 @@
     if input_file:
         input = codecs.open(input_file, 'r', 'utf-8-sig')
     else:
-        input = codecs.getreader('utf-8')(sys.stdin)
+        input = codecs.getreader('utf-8')(sys.stdin.buffer)
     screenplay = fountain.parse(input)
 
     if format == 'pdf':
@@ -114,10 +114,7 @@
             output = sys.stdout.buffer
 
     try:
-        if format == 'text':
-            from screenplain.export.text import to_text
-            to_text(screenplay, output)
-        elif format == 'fdx':
+        if format == 'fdx':
             from screenplain.export.fdx import to_fdx
             to_fdx(screenplay, output)
         elif format == 'html':
@@ -127,12 +124,19 @@
                 css_file=options.css, bare=options.bare
             )
         elif format == 'pdf':
-            from screenplain.export.pdf import to_pdf
-            to_pdf(screenplay, output, is_strong=options.strong)
+            from screenplain.export import pdf
+            settings = pdf.create_default_settings()
+            settings.strong_slugs = options.strong
+            pdf.to_pdf(screenplay, output, settings=settings)
     finally:
         if output_file:
             output.close()
 
 
+def cli():
+    """setup.py entry point for console scripts."""
+    main(sys.argv[1:])
+
+
 if __name__ == '__main__':
     main(sys.argv[1:])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/parsers/fountain.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/parsers/fountain.py
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/parsers/fountain.py    
    2020-08-14 18:47:58.000000000 +0200
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/parsers/fountain.py    
    2023-03-20 14:33:16.000000000 +0100
@@ -57,6 +57,7 @@
         Modifies the `previous_paragraphs` list.
         """
         (
+            self.append_forced_action(previous_paragraphs) or
             self.append_page_break(previous_paragraphs) or
             self.append_synopsis(previous_paragraphs) or
             self.append_sections_and_synopsises(previous_paragraphs) or
@@ -170,9 +171,18 @@
 
         return False
 
+    def append_forced_action(self, paragraphs):
+        if self.lines[0].startswith('!'):
+            return self.append_action(paragraphs)
+        else:
+            return False
+
     def append_action(self, paragraphs):
         paragraphs.append(
-            Action(_sequence_to_rich(line.rstrip() for line in self.lines))
+            Action(_sequence_to_rich(
+                line[1:].rstrip() if line.startswith('!') else line.rstrip()
+                for line in self.lines
+            ))
         )
         return True
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/richstring.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/richstring.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/screenplain/richstring.py      
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/screenplain/richstring.py      
2023-03-20 14:33:16.000000000 +0100
@@ -292,7 +292,7 @@
     pos = 0
 
     def append(pos, end):
-        if(pos == end):
+        if pos == end:
             return
         text = source[pos:end]
         segments.append(Segment(text, styles))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/screenplain-0.9.0+git.1597423678.4e34d1f/setup.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/setup.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/setup.py       2020-08-14 
18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/setup.py       2023-03-20 
14:33:16.000000000 +0100
@@ -3,11 +3,9 @@
 from setuptools import setup
 
 # read the contents of your README file
-import os.path
-import io
-
-this_directory = os.path.abspath(os.path.dirname(__file__))
-with io.open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
+from os import path
+this_directory = path.abspath(path.dirname(__file__))
+with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
     long_description = f.read()
 
 setup(
@@ -39,7 +37,7 @@
     },
     entry_points={
         'console_scripts': [
-            'screenplain = screenplain.main:main',
+            'screenplain = screenplain.main:cli'
         ]
     },
     classifiers=[
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/fdx_test.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/fdx_test.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/fdx_test.py      
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/tests/fdx_test.py      
2023-03-20 14:33:16.000000000 +0100
@@ -2,7 +2,7 @@
 # Licensed under the MIT license:
 # http://www.opensource.org/licenses/mit-license.php
 
-from .testcompat import TestCase
+from unittest import TestCase
 from io import StringIO
 
 from screenplain.export.fdx import write_text
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/extended-characters.fountain
 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/extended-characters.fountain
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/extended-characters.fountain
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/extended-characters.fountain
       2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1,6 @@
+Hello
+こんにちは
+привет
+你好
+안녕하세요
+أهلا
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/extended-characters.fountain.fdx
 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/extended-characters.fountain.fdx
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/extended-characters.fountain.fdx
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/extended-characters.fountain.fdx
   2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<FinalDraft DocumentType="Script" Template="No" Version="1">
+<Content>
+<Paragraph Type="Action">
+<Text>Hello
+</Text>
+<Text>こんにちは
+</Text>
+<Text>привет
+</Text>
+<Text>你好
+</Text>
+<Text>안녕하세요
+</Text>
+<Text>أهلا</Text>
+</Paragraph>
+</Content>
+</FinalDraft>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/extended-characters.fountain.html
 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/extended-characters.fountain.html
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/extended-characters.fountain.html
  1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/extended-characters.fountain.html
  2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1 @@
+<div 
class="action"><p>Hello<br/>&#12371;&#12435;&#12395;&#12385;&#12399;<br/>&#1087;&#1088;&#1080;&#1074;&#1077;&#1090;<br/>&#20320;&#22909;<br/>&#50504;&#45397;&#54616;&#49464;&#50836;<br/>&#1571;&#1607;&#1604;&#1575;</p></div>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-action.fountain 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-action.fountain
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-action.fountain 
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-action.fountain 
    2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1,2 @@
+!THIS IS FORCED ACTION
+This is another line of action!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-action.fountain.fdx
 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-action.fountain.fdx
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-action.fountain.fdx
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-action.fountain.fdx
 2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<FinalDraft DocumentType="Script" Template="No" Version="1">
+<Content>
+<Paragraph Type="Action">
+<Text>THIS IS FORCED ACTION
+</Text>
+<Text>This is another line of action!</Text>
+</Paragraph>
+</Content>
+</FinalDraft>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-action.fountain.html
 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-action.fountain.html
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-action.fountain.html
        1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-action.fountain.html
        2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1 @@
+<div class="action"><p>THIS IS FORCED ACTION<br/>This is another line of 
action!</p></div>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-transition.fountain
 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-transition.fountain
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-transition.fountain
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-transition.fountain
 2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1 @@
+> Black screen indicating a discontinuity of time.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-transition.fountain.html
 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-transition.fountain.html
--- 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files/forced-transition.fountain.html
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files/forced-transition.fountain.html
    2023-03-20 14:33:16.000000000 +0100
@@ -0,0 +1 @@
+<div class="transition">BLACK SCREEN INDICATING A DISCONTINUITY OF TIME.</div>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files_test.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files_test.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/files_test.py    
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/tests/files_test.py    
2023-03-20 14:33:16.000000000 +0100
@@ -4,7 +4,7 @@
 
 from __future__ import with_statement
 
-from .testcompat import TestCase
+from unittest import TestCase
 import tempfile
 import os
 import os.path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/fountain_test.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/fountain_test.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/fountain_test.py 
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/tests/fountain_test.py 
2023-03-20 14:33:16.000000000 +0100
@@ -2,7 +2,7 @@
 # Licensed under the MIT license:
 # http://www.opensource.org/licenses/mit-license.php
 
-from .testcompat import TestCase
+from unittest import TestCase
 
 from screenplain.parsers import fountain
 from screenplain.types import (
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/richstring_test.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/richstring_test.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/richstring_test.py       
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/tests/richstring_test.py       
2023-03-20 14:33:16.000000000 +0100
@@ -2,7 +2,7 @@
 # Licensed under the MIT license:
 # http://www.opensource.org/licenses/mit-license.php
 
-from .testcompat import TestCase
+from unittest import TestCase
 from screenplain.richstring import (
     RichString, Segment,
     Bold, Italic,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/testcompat.py 
new/screenplain-0.9.0+git.1679319196.353e6c9/tests/testcompat.py
--- old/screenplain-0.9.0+git.1597423678.4e34d1f/tests/testcompat.py    
2020-08-14 18:47:58.000000000 +0200
+++ new/screenplain-0.9.0+git.1679319196.353e6c9/tests/testcompat.py    
1970-01-01 01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-# Copyright (c) 2011 Martin Vilcans
-# Licensed under the MIT license:
-# http://www.opensource.org/licenses/mit-license.php
-
-"""Provides compatibility between Python 2 and 3.
-
-In Python 2 we use the unittest2 module.
-The functionality of that module is already in Python 3,
-so we don't depend on it.
-This module exports the TestCase class from whatever unittest library we have.
-
-"""
-
-try:
-    from unittest2 import TestCase
-except ImportError:
-    from unittest import TestCase

Reply via email to