Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof new option #379

Merged
merged 6 commits into from
May 17, 2018
Merged

Proof new option #379

merged 6 commits into from
May 17, 2018

Conversation

miguelsousa
Copy link
Member

No description provided.

This is needed for diff'ing the PDFs that are generated by the *plot tools. By default each page contains a header (a.k.a. Title) that includes a time stamp, among other info. Each PDF page is then compressed using ASCII85. By removing the page header it's possible to do a straight diff of two PDFs, even if their pages are compressed.

In case raw (i.e. uncompressed) pages are needed, use the setPageCompression() method of pdfgen.py
# with the Mac, we need to tag the file in a special
#way so the system knows it is a PDF file.
#This supplied by Joe Strout
if os.name == 'mac':
import macfs
try:
try:
macfs.FSSpec(filename).SetCreatorType('CARO','PDF ')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filename is undefined

@@ -24,20 +25,16 @@
from types import *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change this from

from types import *

to:

from types import ListType

@@ -24,20 +25,16 @@
from types import *
from math import sin, cos, pi, ceil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the following unused imports:

import tempfile
import cStringIO

and

from math import sin, cos, pi, ceil

@@ -61,10 +63,10 @@
from types import *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change

from types import *

to:

from types import FloatType, IntType, ListType, StringType, TupleType

@@ -61,10 +63,10 @@
from types import *
from math import sin, cos, tan, pi, ceil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove ceil from this list, as it is not used

@@ -532,20 +535,20 @@ def setDash(self, array=[], phase=0):
assert phase <= len(array), "setDash phase must be l.t.e. length of array"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in line 534 please change:

elif type(array) == ListType or type(Array) == TupleType:

to:

elif type(array) == ListType or type(array) == TupleType:

(note case of Array vs array)

@@ -575,17 +578,17 @@ def drawInlineImage(self, image, x,y, width=None,height=None):
Also allow file names as well as images. This allows a
caching mechanism"""
# print "drawInlineImage: x=%s, y=%s, width = %s, height=%s " % (x,y, width, height)
try:
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this try/except block, as Image is unused.

@miguelsousa
Copy link
Member Author

@cjchapman all done. Thanks for the review!

@miguelsousa
Copy link
Member Author

I can now get back on finishing #368

@@ -14,15 +14,15 @@

Modified 7/25/2006 read rooberts. Added supported for embedding fonts.
"""
from __future__ import print_function, absolute_import

import os
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now os is unused, so please remove the import os.

##
##
##
from __future__ import print_function, absolute_import

import os
import sys
import string
import time
import tempfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the following unused imports:

import sys

and

import time
import tempfile

(Sorry I could have sworn I wrote this up yesterday, but I don't see it now, so maybe I forgot to hit the "Add..." button.)

@miguelsousa
Copy link
Member Author

@cjchapman done

@cjchapman
Copy link
Contributor

@miguelsousa Approved. I'll leave it to you to merge, as I'm guessing you may want to squash it and summarize the changes.

@miguelsousa miguelsousa merged commit 5d6782c into develop May 17, 2018
@miguelsousa miguelsousa deleted the proof-new-option branch May 17, 2018 17:57
schriftgestalt pushed a commit to schriftgestalt/afdko that referenced this pull request May 18, 2019
This is needed for diff'ing the PDFs that are generated by the *plot tools. By default each page contains a header (a.k.a. Title) that includes a time stamp, among other info. Each PDF page is then compressed using ASCII85. By removing the page header it's possible to do a straight diff of two PDFs, even if their pages are compressed.

In case raw (i.e. uncompressed) pages are needed, use the setPageCompression() method of pdfgen.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants