Skip to content

Commit

Permalink
Fixed eps method runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
aashish24 committed May 28, 2016
1 parent a90c075 commit fdf6beb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions Packages/vcs/vcs/Canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4913,6 +4913,7 @@ def _compute_width_height(self, width, height, units, ps=False):
H = tmp
return W, H


def postscript(self, file, mode='r', orientation=None, width=None, height=None,
units='inches', textAsPaths=True):
"""
Expand Down Expand Up @@ -5330,8 +5331,7 @@ def gs(self, filename='noname.gs', device='png256',
# #
##########################################################################
def eps(self, file, mode='r', orientation=None, width=None, height=None,
units='inches', left_margin=None, right_margin=None, top_margin=None,
bottom_margin=None, textAsPaths=True):
units='inches', textAsPaths=True):
"""
Function: Encapsulated PostScript
Expand Down Expand Up @@ -5369,11 +5369,8 @@ def eps(self, file, mode='r', orientation=None, width=None, height=None,
width,
height,
units,
left_margin,
right_margin,
top_margin,
bottom_margin,
textAsPaths)

os.popen("ps2epsi %s %s" % (tmpfile, file)).readlines()
os.remove(tmpfile)

Expand Down
6 changes: 3 additions & 3 deletions testing/vcs/test_vcs_export_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

x = vcs.init(bg=1, geometry=(800, 600))
txt = x.createtext()
txt.x = [.0000005,.00000005,.5,.99999,.999999]
txt.y = [0.05,.9,.5,.9,0.05]
txt.x = [0.2, 0.2, 0.5, 0.8, 0.8]
txt.y = [0.2, 0.8, 0.5, 0.8, 0.2]
txt.string = ["SAMPLE TEXT A","SAMPLE TEXT B","SAMPLE TEXT C","SAMPLE TEXT D","SAMPLE TEXT E"]
txt.halign = "center"
txt.valign = "base"
Expand All @@ -23,7 +23,7 @@
tmpfile = tempfile.NamedTemporaryFile(suffix='.pdf', \
prefix='textAsPathsFalse', delete=True)
x.pdf(tmpfile.name, textAsPaths=False)
# tmpfile.close()
tmpfile.close()

tmpfile = tempfile.NamedTemporaryFile(suffix='.pdf', \
prefix='textAsPathsTrue', delete=True )
Expand Down

0 comments on commit fdf6beb

Please sign in to comment.