Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4cde2ad

Browse files
author
Chris Glass
committed
More cleanup, removal of unused variables.
1 parent aa9fa72 commit 4cde2ad

File tree

4 files changed

+3
-11
lines changed

4 files changed

+3
-11
lines changed

sx/pisa3/pisa_context.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ def parseExternal(self, cssResourceName):
400400
# print "@import", self.rootPath, cssResourceName
401401
oldRootPath = self.rootPath
402402
cssFile = self.c.getFile(cssResourceName, relative=self.rootPath)
403-
result = []
404403
if not cssFile:
405404
return None
406405
if self.rootPath and urlparse.urlparse(self.rootPath).scheme:

sx/pisa3/pisa_document.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
def pisaErrorDocument(dest, c):
3434
out = pisaTempFile(capacity=c.capacity)
3535
out.write("<p style='background-color:red;'><strong>%d error(s) occured:</strong><p>" % c.err)
36-
for mode, line, msg, code in c.log:
36+
for mode, line, msg, _ in c.log:
3737
if mode=="error":
3838
out.write("<pre>%s in line %d: %s</pre>" % (mode, line, cgi.escape(msg)))
3939

4040
out.write("<p><strong>%d warning(s) occured:</strong><p>" % c.warn)
41-
for mode, line, msg, code in c.log:
41+
for mode, line, msg, _ in c.log:
4242
if mode=="warning":
4343
out.write("<p>%s in line %d: %s</p>" % (mode, line, cgi.escape(msg)))
4444

sx/pisa3/pisa_paragraph.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ def splitIntoLines(self, maxWidth, maxHeight, splitted=False):
350350

351351
# Reset values for new line
352352
posBegin = pos
353-
posSpace = pos
354353
line = Line(style)
355354

356355
# Update boxes for next line
@@ -375,14 +374,12 @@ def splitIntoLines(self, maxWidth, maxHeight, splitted=False):
375374
# If space or linebreak handle special way
376375
if frag.isSoft:
377376
if frag.isLF:
378-
posSpace = pos
379377
line.append(frag)
380378
break
381379
# First element of line should not be a space
382380
if x == 0:
383381
continue
384382
# Keep in mind last possible line break
385-
posSpace = pos - 1
386383

387384
# The elements exceed the current line
388385
elif (fragWidth + x > maxWidth):
@@ -481,8 +478,6 @@ def wrap(self, availWidth, availHeight):
481478
print "*** wrap (%f, %f) needed" % (0, 0)
482479
return 0, 0
483480

484-
style = self.style
485-
486481
# Split lines
487482
width = availWidth # - style.leftIndent - style.rightIndent
488483
self.splitIndex = self.text.splitIntoLines(width, availHeight)

sx/pisa3/pisa_paragraph2.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def splitIntoLines(self, maxWidth, maxHeight, splitted=False):
467467
x += frag["width"]
468468
line.append(frag)
469469

470-
# Keep in mind boxes for next lines
470+
# Keep in mind boxes for next lines
471471
if isinstance(frag, BoxBegin):
472472
boxStack.append(frag)
473473
elif isinstance(frag, BoxEnd):
@@ -563,8 +563,6 @@ def wrap(self, availWidth, availHeight):
563563
print "*** wrap (%f, %f) needed" % (0, 0)
564564
return 0, 0
565565

566-
style = self.style
567-
568566
# Split lines
569567
width = availWidth # - style.leftIndent - style.rightIndent
570568
self.splitIndex = self.text.splitIntoLines(width, availHeight)

0 commit comments

Comments
 (0)