-
Notifications
You must be signed in to change notification settings - Fork 168
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
Proof new option #379
Conversation
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 ') |
There was a problem hiding this comment.
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 * |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 * |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
@cjchapman all done. Thanks for the review! |
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.)
e36ff76
to
42f94cf
Compare
@cjchapman done |
@miguelsousa Approved. I'll leave it to you to merge, as I'm guessing you may want to squash it and summarize the changes. |
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
No description provided.