Merge pull request #290 from VLSIDA/revert-289-update-defunct-code

Revert "Update defunct code"
This commit is contained in:
Matt Guthaus 2026-04-08 11:19:40 -07:00 committed by GitHub
commit 148a5807e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 38 additions and 40 deletions

View File

@ -142,8 +142,8 @@ class polygon_pt:
def alignvector_pt(self, a, dx, dy, alignlinevector, alignpointvector):
n = math.hypot(dx, dy)
dx, dy = dx / n, dy / n
linevectors = map(lambda p, self=self, a=a, dx=dx, dy=dy, alignlinevector=alignlinevector:
alignlinevector(a, dx, dy, *(p[0] + p[1])), self.successivepoints())
linevectors = map(lambda (p1, p2), self=self, a=a, dx=dx, dy=dy, alignlinevector=alignlinevector:
alignlinevector(a, dx, dy, *(p1 + p2)), self.successivepoints())
for linevector in linevectors:
if type(linevector) is types.TupleType:
return linevector

View File

@ -259,7 +259,7 @@ class twolines_pt(connector_pt):
if alength is not None: no_lengths += 1
if no_angles + no_lengths != 2:
raise NotImplementedError("Please specify exactly two angles or lengths")
raise NotImplementedError, "Please specify exactly two angles or lengths"
# calculate necessary angles and armlengths
# always length1 and relangle1
@ -301,7 +301,7 @@ class twolines_pt(connector_pt):
relangle1 = acos((distance**2 + length1**2 - length2**2) / (2.0*distance*length1))
middle = self._middle_a(begin, dangle, length1, relangle1)
else:
raise NotImplementedError("I found a strange combination of arguments")
raise NotImplementedError, "I found a strange combination of arguments"
connectorpath = path.path(path.moveto_pt(*self.box1.center),
path.lineto_pt(*middle),

View File

@ -135,7 +135,7 @@ def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, allownega
return []
if debug:
print("fallback with exact zero value")
print "fallback with exact zero value"
return [(a, b)]
# >>>
def fallback_smallT(T, D, E, AB, curvA, curvB, threshold, debug):# <<<
@ -147,7 +147,7 @@ def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, allownega
abs(b*T) < threshold * q1 and abs(1.5*a*abs(a)*curvA - D) < threshold * q1 and
abs(a*T) < threshold * q2 and abs(1.5*b*abs(b)*curvB - E) < threshold * q2):
if debug:
print("fallback with T approx 0")
print "fallback with T approx 0"
return [(a, b)]
return []
# >>>
@ -161,7 +161,7 @@ def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, allownega
abs(1.5*b*b*curvB) < threshold * min(abs(a*T), abs(E)) and
abs(a*T - E) < threshold * min(abs(a*T), abs(E))):
if debug:
print("fallback with curvB approx 0")
print "fallback with curvB approx 0"
result.append((a, b))
# is curvA approx zero?
@ -171,7 +171,7 @@ def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, allownega
abs(1.5*a*a*curvA) < threshold * min(abs(b*T), abs(D)) and
abs(b*T - D) < threshold * min(abs(b*T), abs(D))):
if debug:
print("fallback with curvA approx 0")
print "fallback with curvA approx 0"
result.append((a, b))
return result
@ -754,7 +754,7 @@ class parallel(deformer): # <<<
# get the next parallel piece for the normpath
try:
next_parallel_normpath = self.deformsubpathitem(next_orig_nspitem, epsilon)
except InvalidParamException as e:
except InvalidParamException, e:
invalid_nspitem_param = e.normsubpathitemparam
# split the nspitem apart and continue with pieces that do not contain
# the invalid point anymore. At the end, simply take one piece, otherwise two.

View File

@ -102,7 +102,7 @@ class TFMError(exceptions.Exception): pass
class char_info_word:
def __init__(self, word):
self.width_index = int((word & 0xFF000000) >> 24) #make sign-safe
self.width_index = int((word & 0xFF000000L) >> 24) #make sign-safe
self.height_index = (word & 0x00F00000) >> 20
self.depth_index = (word & 0x000F0000) >> 16
self.italic_index = (word & 0x0000FC00) >> 10
@ -135,10 +135,10 @@ class tfmfile:
self.ne <= 256 and
self.lf == 6+self.lh+(self.ec-self.bc+1)+self.nw+self.nh+self.nd
+self.ni+self.nl+self.nk+self.ne+self.np):
raise TFMError("error in TFM pre-header")
raise TFMError, "error in TFM pre-header"
if debug:
print("lh=%d" % self.lh)
print "lh=%d" % self.lh
#
# read header
@ -160,9 +160,9 @@ class tfmfile:
self.fontfamily = None
if debug:
print("(FAMILY %s)" % self.fontfamily)
print("(CODINGSCHEME %s)" % self.charcoding)
print("(DESINGSIZE R %f)" % 16.0*self.designsize/16777216)
print "(FAMILY %s)" % self.fontfamily
print "(CODINGSCHEME %s)" % self.charcoding
print "(DESINGSIZE R %f)" % 16.0*self.designsize/16777216L
if self.lh > 17:
self.sevenbitsave = self.file.readuchar()
@ -201,7 +201,7 @@ class tfmfile:
if self.lh > 18:
# just ignore the rest
print(self.file.read((self.lh-18)*4))
print self.file.read((self.lh-18)*4)
#
# read char_info
@ -392,9 +392,9 @@ def readfontmap(filenames):
if not (line=="" or line[0] in (" ", "%", "*", ";" , "#")):
try:
fm = fontmapping(line)
except (RuntimeError, UnsupportedPSFragment) as e:
except (RuntimeError, UnsupportedPSFragment), e:
warnings.warn("Ignoring line %i in mapping file '%s': %s" % (lineno, mappath, e))
except UnsupportedFontFormat as e:
except UnsupportedFontFormat, e:
pass
else:
fontmap[fm.texname] = fm
@ -468,16 +468,16 @@ class font:
def __str__(self):
return "font %s designed at %g TeX pts used at %g TeX pts" % (self.name,
16.0*self.d/16777216,
16.0*self.q/16777216)
16.0*self.d/16777216L,
16.0*self.q/16777216L)
__repr__ = __str__
def getsize_pt(self):
""" return size of font in (PS) points """
# The factor 16/16777216=2**(-20) converts a fix_word (here self.q)
# The factor 16L/16777216L=2**(-20) converts a fix_word (here self.q)
# to the corresponding float. Furthermore, we have to convert from TeX
# points to points, hence the factor 72/72.27.
return 16*self.q/16777216*72/72.27
return 16L*self.q/16777216L*72/72.27
def _convert_tfm_to_dvi(self, length):
# doing the integer math with long integers will lead to different roundings
@ -1269,7 +1269,7 @@ class vffile:
# of the virtual font itself. Note that realscale has
# to be a fix_word (like s)
# XXX: check rounding
reals = int(round(self.scale * (16*self.ds/16777216) * s))
reals = int(round(self.scale * (16*self.ds/16777216L) * s))
# print ("defining font %s -- VF scale: %g, VF design size: %d, relative font size: %d => real size: %d" %
# (fontname, self.scale, self.ds, s, reals)

View File

@ -319,7 +319,7 @@ class epsfile(canvas.canvasitem):
try:
epsfile=open(self.filename,"rb")
except:
raise IOError("cannot open EPS file '%s'" % self.filename)
raise IOError, "cannot open EPS file '%s'" % self.filename
file.write("BeginEPSF\n")

View File

@ -365,9 +365,7 @@ class AFMfile:
else:
raise AFMError("Unsupported key %s in kerning data section" % key)
def _processline_kernpairs(self, line, arg):
direction = arg[0]
i = arg[1]
def _processline_kernpairs(self, line, (direction, i)):
try:
key, args = line.split(None, 1)
except ValueError:
@ -486,6 +484,6 @@ class AFMfile:
if __name__ == "__main__":
a = AFMfile("/opt/local/share/texmf-dist/fonts/afm/yandy/lucida/lbc.afm")
print(a.charmetrics[0].name)
print a.charmetrics[0].name
a = AFMfile("/usr/share/enscript/hv.afm")
print(a.charmetrics[32].name)
print a.charmetrics[32].name

View File

@ -815,9 +815,9 @@ class T1font:
elif 251 <= x <= 254: # mid size ints
cmds.append(-((x - 251)*256) - code.pop(0) - 108)
else: # x = 255, i.e. full size ints
y = ((code.pop(0)*256+code.pop(0))*256+code.pop(0))*256+code.pop(0)
if y > (1 << 31):
cmds.append(y - (1 << 32))
y = ((code.pop(0)*256l+code.pop(0))*256+code.pop(0))*256+code.pop(0)
if y > (1l << 31):
cmds.append(y - (1l << 32))
else:
cmds.append(y)
return cmds
@ -843,7 +843,7 @@ class T1font:
code.append(b)
else:
if cmd < 0:
cmd += 1 << 32
cmd += 1l << 32
cmd, x4 = divmod(cmd, 256)
cmd, x3 = divmod(cmd, 256)
x1, x2 = divmod(cmd, 256)

View File

@ -143,7 +143,7 @@ class exponential:
skipexp1=None,
nomantissaexp=r"{10^{%s}}",
minusnomantissaexp=r"{-10^{%s}}",
mantissamin=tick.rational((1, 1)), mantissamax=tick.rational((10, 1)),
mantissamin=tick.rational((1, 1)), mantissamax=tick.rational((10L, 1)),
skipmantissa1=0, skipallmantissa1=1,
mantissatexter=decimal()):
r"""initializes the instance

View File

@ -51,7 +51,7 @@ class rational:
if autolong:
self.denom = 10 ** len(commaparts[1])
else:
self.denom = 10 ** len(commaparts[1])
self.denom = 10L ** len(commaparts[1])
neg = len(commaparts[0]) and commaparts[0][0] == "-"
if neg:
commaparts[0] = commaparts[0][1:]

View File

@ -82,5 +82,5 @@ writer.writeToFile(gds_file_out)
# inputPath = "./gdsFiles/arrayLayout.gds")
print("LIB: %s" , gds_file_in)
print("\nCompleted ", gds_file_out)
print "LIB: %s" , gds_file_in
print "\nCompleted ", gds_file_out

View File

@ -95,5 +95,5 @@ writer.writeToFile(gds_file_out)
# inputPath = "./gdsFiles/arrayLayout.gds")
print("LIB: %s" % gds_file_in)
print("\nCompleted ", gds_file_out)
print "LIB: %s" % gds_file_in
print "\nCompleted ", gds_file_out

View File

@ -160,7 +160,7 @@ class multibank(design):
self.central_bus_width = self.m2_pitch * self.num_control_lines + 2*self.m2_width
# A space for wells or jogging m2
self.m2_gap = max(2*drc("pwell_to_nwell") + drc("well_enclose_active"),
self.m2_gap = max(2*drc("pwell_to_nwell"] + drc["well_enclose_active"),
2*self.m2_pitch)