summaryrefslogtreecommitdiffstats
path: root/Lib/irix5
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-01-01 19:35:13 (GMT)
committerGuido van Rossum <guido@python.org>1992-01-01 19:35:13 (GMT)
commitbdfcfccbe591e15221f35add01132174c9b4e669 (patch)
tree7e5f0d52b8c44e623b12e8f4b5cd645c361e5aeb /Lib/irix5
parent4d8e859e8f0a209a7e999ce9cc0988156c795949 (diff)
downloadcpython-bdfcfccbe591e15221f35add01132174c9b4e669.zip
cpython-bdfcfccbe591e15221f35add01132174c9b4e669.tar.gz
cpython-bdfcfccbe591e15221f35add01132174c9b4e669.tar.bz2
New == syntax
Diffstat (limited to 'Lib/irix5')
-rwxr-xr-xLib/irix5/auds.py2
-rwxr-xr-xLib/irix5/flp.py58
-rwxr-xr-xLib/irix5/panel.py34
-rwxr-xr-xLib/irix5/panelparser.py12
4 files changed, 53 insertions, 53 deletions
diff --git a/Lib/irix5/auds.py b/Lib/irix5/auds.py
index 549c0a7..fb992a9 100755
--- a/Lib/irix5/auds.py
+++ b/Lib/irix5/auds.py
@@ -69,7 +69,7 @@ def stretch(s, a, b):
ib = ib+b
if i >= m:
break
- if ib = ja:
+ if ib == ja:
out.append(y[i])
else:
out.append((y[i]*(ja-(ib-b)) + y[i-1]*(ib-ja)) / b)
diff --git a/Lib/irix5/flp.py b/Lib/irix5/flp.py
index 71a8f66..dfbad01 100755
--- a/Lib/irix5/flp.py
+++ b/Lib/irix5/flp.py
@@ -49,7 +49,7 @@ def parse_forms(filename):
def _open_formfile(filename):
if filename[-3:] <> '.fd':
filename = filename + '.fd'
- if filename[0] = '/':
+ if filename[0] == '/':
try:
fp = open(filename,'r')
except IOError:
@@ -62,7 +62,7 @@ def _open_formfile(filename):
break
except IOError:
fp = None
- if fp = None:
+ if fp == None:
raise error, 'Cannot find forms file ' + filename
return fp
@@ -77,7 +77,7 @@ def _parse_fd_header(file):
# Now skip until we know number of forms
while 1:
datum = _parse_1_line(file)
- if type(datum) = type(()) and datum[0] = 'Numberofforms':
+ if type(datum) == type(()) and datum[0] == 'Numberofforms':
break
return datum[1]
#
@@ -89,7 +89,7 @@ def _parse_fd_form(file, name):
if datum <> FORMLINE:
raise error, 'Missing === FORM === line'
form = _parse_object(file)
- if form.Name = name or name = None:
+ if form.Name == name or name == None:
objs = []
for j in range(form.Numberofobjects):
obj = _parse_object(file)
@@ -147,7 +147,7 @@ def _parse_line(line):
if not a:
return line
name = line[:a[1][1]]
- if name[0] = 'N':
+ if name[0] == 'N':
name = string.joinfields(string.split(name),'')
name = string.lower(name)
name = string.upper(name[0]) + name[1:]
@@ -167,7 +167,7 @@ def _readline(file):
def _parse_1_line(file):
line = _readline(file)
- while line = '':
+ while line == '':
line = _readline(file)
return _parse_line(line)
@@ -176,7 +176,7 @@ def _skip_object(file):
while not line in (SPLITLINE, FORMLINE, ENDLINE):
pos = file.tell()
line = _readline(file)
- if line = FORMLINE:
+ if line == FORMLINE:
file.seek(pos)
def _parse_object(file):
@@ -185,7 +185,7 @@ def _parse_object(file):
pos = file.tell()
datum = _parse_1_line(file)
if datum in (SPLITLINE, FORMLINE, ENDLINE):
- if datum = FORMLINE:
+ if datum == FORMLINE:
file.seek(pos)
return obj
if type(datum) <> type(()):
@@ -266,27 +266,27 @@ def _create_object(form, odata):
# Internal crfunc: helper function that returns correct create function
#
def _select_crfunc(fm, cl):
- if cl = FL.BEGIN_GROUP: return fm.bgn_group
- elif cl = FL.END_GROUP: return fm.end_group
- elif cl = FL.BITMAP: return fm.add_bitmap
- elif cl = FL.BOX: return fm.add_box
- elif cl = FL.BROWSER: return fm.add_browser
- elif cl = FL.BUTTON: return fm.add_button
- elif cl = FL.CHART: return fm.add_chart
- elif cl = FL.CHOICE: return fm.add_choice
- elif cl = FL.CLOCK: return fm.add_clock
- elif cl = FL.COUNTER: return fm.add_counter
- elif cl = FL.DIAL: return fm.add_dial
- elif cl = FL.FREE: return fm.add_free
- elif cl = FL.INPUT: return fm.add_input
- elif cl = FL.LIGHTBUTTON: return fm.add_lightbutton
- elif cl = FL.MENU: return fm.add_menu
- elif cl = FL.POSITIONER: return fm.add_positioner
- elif cl = FL.ROUNDBUTTON: return fm.add_roundbutton
- elif cl = FL.SLIDER: return fm.add_slider
- elif cl = FL.VALSLIDER: return fm.add_valslider
- elif cl = FL.TEXT: return fm.add_text
- elif cl = FL.TIMER: return fm.add_timer
+ if cl == FL.BEGIN_GROUP: return fm.bgn_group
+ elif cl == FL.END_GROUP: return fm.end_group
+ elif cl == FL.BITMAP: return fm.add_bitmap
+ elif cl == FL.BOX: return fm.add_box
+ elif cl == FL.BROWSER: return fm.add_browser
+ elif cl == FL.BUTTON: return fm.add_button
+ elif cl == FL.CHART: return fm.add_chart
+ elif cl == FL.CHOICE: return fm.add_choice
+ elif cl == FL.CLOCK: return fm.add_clock
+ elif cl == FL.COUNTER: return fm.add_counter
+ elif cl == FL.DIAL: return fm.add_dial
+ elif cl == FL.FREE: return fm.add_free
+ elif cl == FL.INPUT: return fm.add_input
+ elif cl == FL.LIGHTBUTTON: return fm.add_lightbutton
+ elif cl == FL.MENU: return fm.add_menu
+ elif cl == FL.POSITIONER: return fm.add_positioner
+ elif cl == FL.ROUNDBUTTON: return fm.add_roundbutton
+ elif cl == FL.SLIDER: return fm.add_slider
+ elif cl == FL.VALSLIDER: return fm.add_valslider
+ elif cl == FL.TEXT: return fm.add_text
+ elif cl == FL.TIMER: return fm.add_timer
else:
raise error, 'Unknown object type: ' + `cl`
diff --git a/Lib/irix5/panel.py b/Lib/irix5/panel.py
index 9fda1c6..21a17ba 100755
--- a/Lib/irix5/panel.py
+++ b/Lib/irix5/panel.py
@@ -17,7 +17,7 @@ debug = 0
# Test if an object is a list.
#
def is_list(x):
- return type(x) = type([])
+ return type(x) == type([])
# Reverse a list.
@@ -34,7 +34,7 @@ def reverse(list):
#
def getattrlist(list, name):
for item in list:
- if item and is_list(item) and item[0] = name:
+ if item and is_list(item) and item[0] == name:
return item[1:]
return []
@@ -43,8 +43,8 @@ def getattrlist(list, name):
#
def getproplist(list, name):
for item in list:
- if item and is_list(item) and item[0] = 'prop':
- if len(item) > 1 and item[1] = name:
+ if item and is_list(item) and item[0] == 'prop':
+ if len(item) > 1 and item[1] == name:
return item[2:]
return []
@@ -53,7 +53,7 @@ def getproplist(list, name):
#
def is_endgroup(list):
x = getproplist(list, 'end-of-group')
- return (x and x[0] = '#t')
+ return (x and x[0] == '#t')
# Neatly display an actuator definition given as S-expression
@@ -63,13 +63,13 @@ def show_actuator(prefix, a):
for item in a:
if not is_list(item):
print prefix, item
- elif item and item[0] = 'al':
+ elif item and item[0] == 'al':
print prefix, 'Subactuator list:'
for a in item[1:]:
show_actuator(prefix + ' ', a)
- elif len(item) = 2:
+ elif len(item) == 2:
print prefix, item[0], '=>', item[1]
- elif len(item) = 3 and item[0] = 'prop':
+ elif len(item) == 3 and item[0] == 'prop':
print prefix, 'Prop', item[1], '=>',
print item[2]
else:
@@ -82,13 +82,13 @@ def show_panel(prefix, p):
for item in p:
if not is_list(item):
print prefix, item
- elif item and item[0] = 'al':
+ elif item and item[0] == 'al':
print prefix, 'Actuator list:'
for a in item[1:]:
show_actuator(prefix + ' ', a)
- elif len(item) = 2:
+ elif len(item) == 2:
print prefix, item[0], '=>', item[1]
- elif len(item) = 3 and item[0] = 'prop':
+ elif len(item) == 3 and item[0] == 'prop':
print prefix, 'Prop', item[1], '=>',
print item[2]
else:
@@ -112,14 +112,14 @@ def dummy_callback(arg):
#
def assign_members(target, attrlist, exclist, prefix):
for item in attrlist:
- if is_list(item) and len(item) = 2 and item[0] not in exclist:
+ if is_list(item) and len(item) == 2 and item[0] not in exclist:
name, value = item[0], item[1]
ok = 1
if value[0] in '-0123456789':
value = eval(value)
- elif value[0] = '"':
+ elif value[0] == '"':
value = value[1:-1]
- elif value = 'move-then-resize':
+ elif value == 'move-then-resize':
# Strange default set by Panel Editor...
ok = 0
else:
@@ -148,7 +148,7 @@ def build_actuator(descr):
else:
actuatorname = ''
type = descr[0]
- if type[:4] = 'pnl_': type = type[4:]
+ if type[:4] == 'pnl_': type = type[4:]
act = pnl.mkact(type)
act.downfunc = act.activefunc = act.upfunc = dummy_callback
#
@@ -158,9 +158,9 @@ def build_actuator(descr):
#
datalist = getattrlist(descr, 'data')
prefix = ''
- if type[-4:] = 'puck':
+ if type[-4:] == 'puck':
prefix = 'puck_'
- elif type = 'mouse':
+ elif type == 'mouse':
prefix = 'mouse_'
assign_members(act, datalist, [], prefix)
#
diff --git a/Lib/irix5/panelparser.py b/Lib/irix5/panelparser.py
index 9c9ee02..1b069fa 100755
--- a/Lib/irix5/panelparser.py
+++ b/Lib/irix5/panelparser.py
@@ -20,16 +20,16 @@ def tokenize_string(s):
c = s[:1]
if c in whitespace:
s = s[1:]
- elif c = ';':
+ elif c == ';':
s = ''
- elif c = '"':
+ elif c == '"':
n = len(s)
i = 1
while i < n:
c = s[i]
i = i+1
- if c = '"': break
- if c = '\\': i = i+1
+ if c == '"': break
+ if c == '\\': i = i+1
tokens.append(s[:i])
s = s[i:]
elif c in operators:
@@ -78,9 +78,9 @@ def parse_expr(tokens):
while 1:
if not tokens:
raise syntax_error, 'missing ")"'
- if tokens[0] = ')':
+ if tokens[0] == ')':
return expr, tokens[1:]
- elif tokens[0] = '(':
+ elif tokens[0] == '(':
subexpr, tokens = parse_expr(tokens)
expr.append(subexpr)
else: