summaryrefslogtreecommitdiffstats
path: root/Demo/scripts/lpwatch.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/scripts/lpwatch.py
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.zip
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.bz2
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/scripts/lpwatch.py')
-rwxr-xr-xDemo/scripts/lpwatch.py8
1 files changed, 4 insertions, 4 deletions
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 @@ def main():
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 @@ def main():
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 @@ def makestatus(name, thisuser):
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 @@ def makestatus(name, thisuser):
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: