Hello community,

here is the log from the commit of package pdfcompare for openSUSE:Factory 
checked in at 2014-01-14 21:51:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pdfcompare (Old)
 and      /work/SRC/openSUSE:Factory/.pdfcompare.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pdfcompare"

Changes:
--------
--- /work/SRC/openSUSE:Factory/pdfcompare/pdfcompare.changes    2013-12-04 
12:30:29.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.pdfcompare.new/pdfcompare.changes       
2014-01-14 21:51:50.000000000 +0100
@@ -1,0 +2,5 @@
+Tue Jan  7 15:59:48 CET 2014 - [email protected]
+
+- V1.6.5 - merged https://github.com/jnweiger/pdfcompare/pull/4 from tomschr
+
+-------------------------------------------------------------------

Old:
----
  pdfcompare-1.6.4.tar.bz2

New:
----
  pdfcompare-1.6.5.tar.bz2

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

Other differences:
------------------
++++++ pdfcompare.spec ++++++
--- /var/tmp/diff_new_pack.l9qeDk/_old  2014-01-14 21:51:51.000000000 +0100
+++ /var/tmp/diff_new_pack.l9qeDk/_new  2014-01-14 21:51:51.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package pdfcompare
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -9,15 +9,15 @@
 # file, is the same license as for the pristine package itself (unless the
 # license for the pristine package is not an Open Source License, in which
 # case the license is the MIT License). An "Open Source License" is a
-# license that conforms to the Open Source Definition (version 1.9)
+# license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
-#
+
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
 
 Name:           pdfcompare
-Version:        1.6.4
+Version:        1.6.5
 Release:        0
 Summary:        Compare two PDF files, write a resulting PDF with highlighted 
changes
 License:        GPL-2.0
@@ -26,43 +26,40 @@
 Source:         pdfcompare-%version.tar.bz2
 
 # These BuildRequires are only required for the testsuite
+BuildRequires:  poppler-tools
 BuildRequires:  python-base
 BuildRequires:  python-pygame
-BuildRequires:  python-reportlab
 BuildRequires:  python-pypdf
-BuildRequires:  poppler-tools
+BuildRequires:  python-reportlab
 BuildRequires:  python-xml
 %if 0%{?suse_version} >= 1210
 # some testsuite tools are not available before openSUSE 12.1
-BuildRequires:  python-scipy
-BuildRequires:  pdftk
 BuildRequires:  ImageMagick
 BuildRequires:  ghostscript
+BuildRequires:  pdftk
+BuildRequires:  python-scipy
 BuildRequires:  shunit2
 %endif
 
+Requires:       poppler-tools
 Requires:       python-base
 Requires:       python-pygame
-Requires:       python-reportlab
 Requires:       python-pypdf
-Requires:       poppler-tools
+Requires:       python-reportlab
 Requires:       python-xml
 ## only needed for --spell
 Requires:       hunspell
 Recommends:    myspell-american
 Recommends:    myspell-german-old
-Buildroot:      %{_tmppath}/%{name}-%{version}-build
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
 
-
-
 %description
 Compare two PDF files, write a resulting PDF with highlighted changes.
 Potential text portions that were moved around are recognized and analyzed 
 for similarity with a second level diff.
 
 %prep
-# unpack tarball, setup parameter googeln/howto
 %setup
 
 %build
@@ -80,7 +77,6 @@
 %install
 install -Dm 0755 pdfcompare.py %{buildroot}%{_bindir}/pdfcompare
 
-
 %files
 %defattr(-, root, root, -)
 %{_bindir}/pdfcompare

++++++ pdfcompare-1.6.4.tar.bz2 -> pdfcompare-1.6.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfcompare-1.6.4/pdfcompare.py 
new/pdfcompare-1.6.5/pdfcompare.py
--- old/pdfcompare-1.6.4/pdfcompare.py  2013-06-13 18:08:57.000000000 +0200
+++ new/pdfcompare-1.6.5/pdfcompare.py  2014-01-07 15:28:01.000000000 +0100
@@ -1,4 +1,5 @@
 #! /usr/bin/python
+# -*- coding: UTF-8 -*-
 #
 # pdf_highlight.py -- command line tool to show search or compare results in a 
PDF
 #
@@ -76,10 +77,17 @@
 #                       - Distinction between mediabox and cropbox 
implemented, so that
 #                         changebars and navigation is not outside the visible 
area.
 #                       - option --leftside added.
-# 2013-05-07, V1.6.3 jw - Not-strict improved: better ignore hyphenation 
change and dotted lines.
-#                         Debugging "mergeAnnots failed: page_idx 18 out of 
range. Have 10"
+# 2013-05-07, V1.6.3 jw - Not-strict improved: better ignore hyphenation change
+#                         and dotted lines.  Debugging "mergeAnnots failed: 
page_idx 18 
+#                         out of range. Have 10" - no help.
 # 2013-05-07, V1.6.4 jw - Allow pdftohtml to produce slightly invalid xml.
-#                         We compensate using a fallback that erases all 
<a...> ... </a> tags.
+#                         We compensate using a fallback that erases all 
<a...> ... </a> 
+#                         tags. Debugging "mergeAnnots failed: page_idx 18 out 
of range.
+#                         Have 10" - no help. New mergeAnnotsRelocate() solves 
this.
+#                         passing -l -f to pdftohtml, but this has no effect 
on speed 
+#                         later on. Strange.
+# 2014-01-07, V1.6.5 jw - manually merged 
https://github.com/jnweiger/pdfcompare/pull/4
+#                         hope, I did not break too much...
 #
 # osc in devel:languages:python python-pypdf >= 1.13+20130112
 #  need fix from https://bugs.launchpad.net/pypdf/+bug/242756
@@ -104,8 +112,10 @@
 
 # Compatibility for older Python versions
 from __future__ import with_statement
+from __future__ import print_function
+# from __future__ import division
 
-__VERSION__ = '1.6.4'
+__VERSION__ = '1.6.5'
 
 try:
   # python2
@@ -402,7 +412,7 @@
 #     super(RelaxedXMLParser,self).feed(data)
 
 
-def pdf2xml(parser, infile, key=''):
+def pdf2xml(parser, infile, key='', firstpage=None, lastpage=None):
   """ read a pdf file with pdftohtml and parse the resulting xml into a dom 
tree
       the first parameter, parser is only used for calling exit() with proper 
messages.
 
@@ -411,13 +421,13 @@
       is attemted, if the normal cElementTree parser fails.
       This compensates for a bug in pdftohtml -xml yielding invalid xml.
   """
-  dom = do_pdf2xml(parser, infile, key='', relaxed=False)
+  dom = do_pdf2xml(parser, infile, key=key, firstpage=firstpage, 
lastpage=lastpage, relaxed=False)
   if dom is None:
     print(" pdf2xml retrying more relaxed ...")
-    dom = do_pdf2xml(parser, infile, key='', relaxed=True)
+    dom = do_pdf2xml(parser, infile, key=key, firstpage=firstpage, 
lastpage=lastpage, relaxed=True)
   return dom
 
-def do_pdf2xml(parser, infile, key='', relaxed=False):
+def do_pdf2xml(parser, infile, key='', firstpage=None, lastpage=None, 
relaxed=False):
   """ read a pdf file with pdftohtml and parse the resulting xml into a dom 
tree
       the first parameter, parser is only used for calling exit() with proper 
messages.
 
@@ -425,6 +435,10 @@
       for some cases is provided, if relaxed=True.
   """
   pdftohtml_cmd = ["pdftohtml", "-q", "-i", "-nodrm", "-nomerge", "-stdout", 
"-xml"]
+  if firstpage is not None:
+    pdftohtml_cmd += ["-f", firstpage]
+  if lastpage is not None:
+    pdftohtml_cmd += ["-l", lastpage]
   if len(key):
     pdftohtml_cmd += ["-upw", key]
   try:
@@ -462,8 +476,9 @@
      punctuation) used for spell checking.
   """
 
-  def __eq__(a,b):
-    return a[0] == b[0]
+  def __eq__(self, other):
+    return self[0] == other[0]
+
   def __hash__(self):
     return hash(self[0])
 
@@ -810,12 +825,12 @@
 
   if not os.access(args.infile, os.R_OK):
     parser.exit("Cannot read input file: %s" % args.infile)
-  dom1 = pdf2xml(parser, args.infile, args.decrypt_key)
+  dom1 = pdf2xml(parser, args.infile, key=args.decrypt_key, 
firstpage=args.first_page, lastpage=args.last_page)
   dom2 = None
   wordlist2 = None
   if args.compare_text:
     if re.search('\.pdf$', args.compare_text, re.I):
-      dom2 = pdf2xml(parser, args.compare_text, args.decrypt_key)
+      dom2 = pdf2xml(parser, args.compare_text, key=args.decrypt_key, 
firstpage=args.first_page, lastpage=args.last_page)
       first_page = args.first_page
       if first_page is not None: first_page = int(first_page) - 1
       last_page = args.last_page
@@ -911,8 +926,8 @@
       print("DocumentInfo():")
       pprint(di)
     output._objects.append(di)
-  except Exception as e:
-    print("WARNING: getDocumentInfo() failed: " + str(e) );
+  except Exception,e:
+    print("WARNING: getDocumentInfo() failed: " + str(e) )
 
   output._info = Pdf.IndirectObject(len(output._objects), 0, output)
 
@@ -1005,6 +1020,7 @@
       traceback.print_exc()
       print("\n\nYou found a bug. Maybe retry with --below ?")
       sys.exit(1)
+    outputStream.close()
     print("%s (%s pages) written." % (args.output, pages_written))
 
   if total_hits:
@@ -1057,7 +1073,7 @@
   return (xoff+pre_w*ratio, str_w*ratio)
 
 def create_mark(text,offset,length, font, t_x, t_y, t_w, t_h, ext={}):
-  #print("word: at %d is '%s'" % (offset, text[offset:offset+length]))
+  #print("word: at %d is '%s'" % (offset, text[offset:offset+length]),)
     
   (xoff,width) = rendered_text_pos(text, offset, length,
                           font, float(t_x), float(t_w))
@@ -1364,7 +1380,7 @@
         else:
           continue
       else:
-        print("unknown opcode: %s" % tag)
+        print("SequenceMatcher returned unknown tag: %s" % tag)
         continue
       # print("len(wl_new)=%d, j in [%d:%d] %s" % (len(wl_new), j1, j2,tag))
       for j in range(j1,j2):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfcompare-1.6.4/test/Makefile 
new/pdfcompare-1.6.5/test/Makefile
--- old/pdfcompare-1.6.4/test/Makefile  2013-02-12 17:33:28.000000000 +0100
+++ new/pdfcompare-1.6.5/test/Makefile  2013-10-24 14:09:14.000000000 +0200
@@ -10,6 +10,8 @@
        env PATH=.:$$PATH refresh=$(refresh) sh ./restest.sh
        rm pdfcompare
 
+# updates the testsuite after code changes 
+# that affect the visual representation.
 refresh:
        # we only need to refresh restest.sh
        env PATH=.:$$PATH refresh=yes sh ./restest.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdfcompare-1.6.4/test/restest.sh 
new/pdfcompare-1.6.5/test/restest.sh
--- old/pdfcompare-1.6.4/test/restest.sh        2013-02-12 17:33:28.000000000 
+0100
+++ new/pdfcompare-1.6.5/test/restest.sh        2013-10-24 14:10:40.000000000 
+0200
@@ -2,8 +2,8 @@
 #
 # This script compares the output pdf of a new pdfcompare version
 # with a test-pdf. 
-###DONE diff geht nicht->'grep -a /Annot' vergleichen, pdftotext rpobieren o 
valides pdf
-# eventuell graphik rendern + vergleichen (wie pdf nach graphik?) 
+###DONE diff geht nicht->'grep -a /Annot' vergleichen, pdftotext probieren ob 
valides PDF
+# eventuell Graphik rendern + vergleichen (wie pdf nach graphik?) 
 #
 ## run once with refresh=yes, after you verified the test suite runs ok.
 #refresh=yes

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to