Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
diff --git a/Demo/scripts/lpwatch.py b/Demo/scripts/lpwatch.py
index c3dcb34..567385c 100755
--- a/Demo/scripts/lpwatch.py
+++ b/Demo/scripts/lpwatch.py
@@ -25,7 +25,7 @@
if printers[i][:2] == '-P':
printers[i] = printers[i][2:]
else:
- if posix.environ.has_key('PRINTER'):
+ if 'PRINTER' in posix.environ:
printers = [posix.environ['PRINTER']]
else:
printers = [DEF_PRINTER]
@@ -36,7 +36,7 @@
text = clearhome
for name in printers:
text = text + makestatus(name, thisuser) + '\n'
- print text
+ print(text)
time.sleep(delay)
def makestatus(name, thisuser):
@@ -66,7 +66,7 @@
aheadjobs = aheadjobs + 1
totalbytes = totalbytes + bytes
totaljobs = totaljobs + 1
- if users.has_key(user):
+ if user in users:
ujobs, ubytes = users[user]
else:
ujobs, ubytes = 0, 0
@@ -87,7 +87,7 @@
if totaljobs != len(users):
line = line + ' (%d jobs)' % totaljobs
if len(users) == 1:
- line = line + ' for %s' % (users.keys()[0],)
+ line = line + ' for %s' % (list(users.keys())[0],)
else:
line = line + ' for %d users' % len(users)
if userseen: