Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package pdfarranger for openSUSE:Factory 
checked in at 2022-03-20 20:55:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pdfarranger (Old)
 and      /work/SRC/openSUSE:Factory/.pdfarranger.new.25692 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pdfarranger"

Sun Mar 20 20:55:33 2022 rev:4 rq:963195 version:1.8.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/pdfarranger/pdfarranger.changes  2021-12-13 
20:50:45.988649126 +0100
+++ /work/SRC/openSUSE:Factory/.pdfarranger.new.25692/pdfarranger.changes       
2022-03-20 20:55:47.302547162 +0100
@@ -1,0 +2,6 @@
+Sun Mar 20 08:33:39 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr>
+
+- Update to 1.8.2:
+  * Fix 2 bugs in scaled pages export
+
+-------------------------------------------------------------------

Old:
----
  pdfarranger-1.8.1.tar.gz

New:
----
  pdfarranger-1.8.2.tar.gz

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

Other differences:
------------------
++++++ pdfarranger.spec ++++++
--- /var/tmp/diff_new_pack.MnaLot/_old  2022-03-20 20:55:47.910548037 +0100
+++ /var/tmp/diff_new_pack.MnaLot/_new  2022-03-20 20:55:47.914548042 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package pdfarranger
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 # Copyright (c) 2020 Karl Cheng <qantas94he...@gmail.com>
 #
 # All modifications and additions to the file contributed by third parties
@@ -18,7 +18,7 @@
 
 
 Name:           pdfarranger
-Version:        1.8.1
+Version:        1.8.2
 Release:        0
 Summary:        Merge, split, rotate, crop, and rearrange pages of PDF 
documents
 License:        GPL-3.0-only

++++++ pdfarranger-1.8.1.tar.gz -> pdfarranger-1.8.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfarranger-1.8.1/.github/workflows/install.yml 
new/pdfarranger-1.8.2/.github/workflows/install.yml
--- old/pdfarranger-1.8.1/.github/workflows/install.yml 2021-12-10 
10:58:34.000000000 +0100
+++ new/pdfarranger-1.8.2/.github/workflows/install.yml 2021-12-25 
17:53:29.000000000 +0100
@@ -6,7 +6,8 @@
 jobs:
   build:
     runs-on: ubuntu-latest
-    container: jeromerobert/pdfarranger-docker-ci
+    # PikePDF 4.2.0
+    container: jeromerobert/pdfarranger-docker-ci:1.4
     steps:
     - uses: actions/checkout@v2
     - name: Install
@@ -19,6 +20,16 @@
       run: python3 -X tracemalloc -u -m unittest discover -v -f -s tests
     - name: Codecov
       run: curl -s https://codecov.io/bash | bash
+  build-old-pikepdf:
+    runs-on: ubuntu-latest
+    # PikePDF 1.19
+    container: jeromerobert/pdfarranger-docker-ci:1.3.1
+    steps:
+    - uses: actions/checkout@v2
+    - name: Install
+      run: pip3 install .[image]
+    - name: Tests and Coverage
+      run: python3 -X tracemalloc -u -m unittest discover -v -f -s tests
   build-win32:
     runs-on: ubuntu-latest
     container:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdfarranger-1.8.1/data/com.github.jeromerobert.pdfarranger.metainfo.xml 
new/pdfarranger-1.8.2/data/com.github.jeromerobert.pdfarranger.metainfo.xml
--- old/pdfarranger-1.8.1/data/com.github.jeromerobert.pdfarranger.metainfo.xml 
2021-12-10 10:58:34.000000000 +0100
+++ new/pdfarranger-1.8.2/data/com.github.jeromerobert.pdfarranger.metainfo.xml 
2021-12-25 17:53:29.000000000 +0100
@@ -60,6 +60,7 @@
   </screenshots>
   <update_contact>jeromerob...@gmx.com</update_contact>
   <releases>
+    <release date="2021-12-25" version="1.8.2"/>
     <release date="2021-12-10" version="1.8.1"/>
     <release date="2021-11-13" version="1.8.0"/>
     <release date="2021-03-13" version="1.7.1"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfarranger-1.8.1/pdfarranger/exporter.py 
new/pdfarranger-1.8.2/pdfarranger/exporter.py
--- old/pdfarranger-1.8.1/pdfarranger/exporter.py       2021-12-10 
10:58:34.000000000 +0100
+++ new/pdfarranger-1.8.2/pdfarranger/exporter.py       2021-12-25 
17:53:29.000000000 +0100
@@ -17,6 +17,7 @@
 
 import pikepdf
 import os
+import traceback
 import tempfile
 from . import metadata
 from gi.repository import Gtk
@@ -91,7 +92,6 @@
         # unset it on the input page before
         rotate = page.Rotate
         page.Rotate = 0
-    page = doc.make_indirect(page)
     page_id = len(doc.pages)
     newmediabox = [factor * float(x) for x in page.MediaBox]
     content = "q {} 0 0 {} 0 0 cm /p{} Do Q".format(factor, factor, page_id)
@@ -145,6 +145,15 @@
     if angle != 0:
         output_page.Rotate = angle + angle0
 
+def _remove_unreferenced_resources(pdfdoc):
+    try:
+        pdfdoc.remove_unreferenced_resources()
+    except RuntimeError:
+       # Catch "RuntimeError: operation for dictionary attempted on object of
+       # type null" with old version PikePDF (observed with 1.17 and 1.19).
+       # Blindly catch all RuntimeError is dangerous as this may catch
+       # unwanted exception so we print it.
+        print(traceback.format_exc())
 
 def export(input_files, pages, file_out, mode, mdata):
     exportmodes = {0: 'ALL_TO_SINGLE',
@@ -198,11 +207,11 @@
             if n > 0:
                 # Add page number to filename
                 outname = "".join(parts[:-1]) + str(n + 1) + '.' + parts[-1]
-            outpdf.remove_unreferenced_resources()
+            _remove_unreferenced_resources(outpdf)
             outpdf.save(outname)
     else:
         _set_meta(mdata, pdf_input, pdf_output)
-        pdf_output.remove_unreferenced_resources()
+        _remove_unreferenced_resources(pdf_output)
         pdf_output.save(file_out)
 
 def num_pages(filepath):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfarranger-1.8.1/pdfarranger/pdfarranger.py 
new/pdfarranger-1.8.2/pdfarranger/pdfarranger.py
--- old/pdfarranger-1.8.1/pdfarranger/pdfarranger.py    2021-12-10 
10:58:34.000000000 +0100
+++ new/pdfarranger-1.8.2/pdfarranger/pdfarranger.py    2021-12-25 
17:53:29.000000000 +0100
@@ -70,7 +70,7 @@
     del libintl
 
 APPNAME = 'PDF Arranger'
-VERSION = '1.8.1'
+VERSION = '1.8.2'
 WEBSITE = 'https://github.com/pdfarranger/pdfarranger'
 
 if os.name == 'nt':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfarranger-1.8.1/setup.py 
new/pdfarranger-1.8.2/setup.py
--- old/pdfarranger-1.8.1/setup.py      2021-12-10 10:58:34.000000000 +0100
+++ new/pdfarranger-1.8.2/setup.py      2021-12-25 17:53:29.000000000 +0100
@@ -33,7 +33,7 @@
 
 setup(
     name='pdfarranger',
-    version='1.8.1',
+    version='1.8.2',
     author='Jerome Robert',
     author_email='jeromerob...@gmx.com',
     description='A simple application for PDF Merging, Rearranging, and 
Splitting',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfarranger-1.8.1/setup_win32.py 
new/pdfarranger-1.8.2/setup_win32.py
--- old/pdfarranger-1.8.1/setup_win32.py        2021-12-10 10:58:34.000000000 
+0100
+++ new/pdfarranger-1.8.2/setup_win32.py        2021-12-25 17:53:29.000000000 
+0100
@@ -1,4 +1,4 @@
-VERSION='1.8.1'
+VERSION='1.8.2'
 
 from cx_Freeze import setup, Executable
 import os
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfarranger-1.8.1/tests/test.py 
new/pdfarranger-1.8.2/tests/test.py
--- old/pdfarranger-1.8.1/tests/test.py 2021-12-10 10:58:34.000000000 +0100
+++ new/pdfarranger-1.8.2/tests/test.py 2021-12-25 17:53:29.000000000 +0100
@@ -126,6 +126,16 @@
 
 class PdfArrangerTest(unittest.TestCase):
     LAST=False
+    def _start(self, args=None):
+        from dogtail.config import config
+        config.searchBackoffDuration = 1
+        self.__class__.pdfarranger = PdfArrangerManager(args)
+        # check that process is actually running
+        self.assertIsNone(self._process().poll())
+        self._app()
+        # Now let's go faster
+        config.searchBackoffDuration = 0.1
+
     def _app(self):
         # Cannot import at top level because of DBUS_SESSION_BUS_ADDRESS
         from dogtail.tree import root
@@ -150,13 +160,20 @@
             self.assertLess(c, 30)
             c += 1
 
-    def _assert_selected(self, selection):
+    def _status_text(self):
         app = self._app()
         from dogtail import predicate
         allstatusbar = 
app.findChildren(predicate.GenericPredicate(roleName="status bar"), 
showingOnly=False)
         # If we have multiple status bar, concider the last one as the one who 
display the selection
         statusbar = allstatusbar[-1]
-        self.assertTrue(statusbar.name.startswith("Selected pages: " + 
selection))
+        return statusbar.name
+
+    def _assert_selected(self, selection):
+        self.assertTrue(self._status_text().startswith("Selected pages: " + 
selection))
+
+    def _assert_page_size(self, width, height):
+        label = " {:.1f}mm \u00D7 {:.1f}mm".format(width, height)
+        self.assertTrue(self._status_text().endswith("Page Size:" + label))
 
     def _icons(self):
         """Return the list of page icons"""
@@ -214,13 +231,7 @@
 
 class TestBatch1(PdfArrangerTest):
     def test_01_import_img(self):
-        self.__class__.pdfarranger = 
PdfArrangerManager(["data/screenshot.png"])
-        # check that process is actually running
-        self.assertIsNone(self._process().poll())
-        self._app()
-        from dogtail.config import config
-        # Now let's go faster
-        config.searchBackoffDuration = 0.1
+        self._start(["data/screenshot.png"])
 
     def test_02_properties(self):
         self._mainmenu("Edit Properties")
@@ -349,14 +360,7 @@
 
 class TestBatch2(PdfArrangerTest):
     def test_01_open_empty(self):
-        from dogtail.config import config
-        config.searchBackoffDuration = 1
-        self.__class__.pdfarranger = PdfArrangerManager()
-        # check that process is actually running
-        self.assertIsNone(self._process().poll())
-        self._app()
-        # Now let's go faster
-        config.searchBackoffDuration = 0.1
+        self._start()
 
     def test_02_import(self):
         filechooser = self._import_file("tests/test.pdf")
@@ -397,20 +401,11 @@
 
 
 class TestBatch3(PdfArrangerTest):
-    # Kill X11 after that batch
-    LAST=True
     def test_01_open_encrypted(self):
-        from dogtail.config import config
-        config.searchBackoffDuration = 1
         filename = os.path.join(self.__class__.tmp, "other_encrypted.pdf")
         shutil.copyfile("tests/test_encrypted.pdf", filename)
-        self.__class__.pdfarranger = PdfArrangerManager([filename])
-        # check that process is actually running
-        self.assertIsNone(self._process().poll())
-        app = self._app()
-        # Now let's go faster
-        config.searchBackoffDuration = 0.1
-        dialog = app.child(roleName="dialog")
+        self._start([filename])
+        dialog = self._app().child(roleName="dialog")
         passfield = dialog.child(roleName="password text")
         passfield.text = "foobar"
         dialog.child(name="OK").click()
@@ -439,3 +434,55 @@
         dialog.child(name="Replace").click()
         # check that process actually exit
         self._process().wait(timeout=22)
+
+
+class TestBatch4(PdfArrangerTest):
+    # Kill X11 after that batch
+    LAST=True
+    def test_01_import_pdf(self):
+        self._start(["tests/test.pdf"])
+
+    def test_02_duplicate(self):
+        app = self._app()
+        app.keyCombo("Down")
+        self._popupmenu(0, ["Duplicate"])
+        app.keyCombo("Right")
+
+    def test_03_scale(self):
+        app = self._app()
+        app.keyCombo("C")
+        dialog = self._app().child(roleName="dialog")
+        from dogtail import rawinput
+        rawinput.keyCombo("Tab")
+        rawinput.typeText("200")
+        dialog.child(name="OK").click()
+        self._wait_cond(lambda: dialog.dead)
+        app.keyCombo("<ctrl>Left")  # rotate left
+        self._assert_selected("2")
+        self._assert_page_size(558.8, 431.8)
+
+    def test_04_export(self):
+        app = self._app()
+        app.keyCombo("<ctrl>a")  # select all
+        self._mainmenu(["Export", "Export Selection to a Single File???"])
+        filechooser = self._app().child(roleName="file chooser")
+        tmp = self.__class__.tmp
+        filename = os.path.join(tmp, "scaled.pdf")
+        filechooser.child(roleName="text").text = filename
+        saveb = filechooser.button("Save")
+        self._wait_cond(lambda: saveb.sensitive)
+        filechooser.button("Save").click()
+        self._wait_cond(lambda: os.path.isfile(filename))
+        self._popupmenu(1, "Delete")
+
+    def test_05_import(self):
+        filename = os.path.join(self.__class__.tmp, "scaled.pdf")
+        filechooser = self._import_file(filename)
+        self._wait_cond(lambda: filechooser.dead)
+        self.assertEqual(len(self._icons()), 3)
+        app = self._app()
+        self._app().child(roleName="layered pane").grabFocus()
+        app.keyCombo("Right")
+        app.keyCombo("Right")
+        self._assert_selected("2")
+        self._assert_page_size(558.8, 431.8)

Reply via email to