summaryrefslogtreecommitdiffstats
path: root/Demo/sgi
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-02-25 00:16:27 (GMT)
committerGuido van Rossum <guido@python.org>1993-02-25 00:16:27 (GMT)
commit83c81448b1db067a8eeea140afbde525499f507b (patch)
tree72445b4ff30e60de638959de3bda8ac7edaf819d /Demo/sgi
parent09bf3e310be7d79b63430f2e9f44865af7f1bb3b (diff)
downloadcpython-83c81448b1db067a8eeea140afbde525499f507b.zip
cpython-83c81448b1db067a8eeea140afbde525499f507b.tar.gz
cpython-83c81448b1db067a8eeea140afbde525499f507b.tar.bz2
Fix terse mode for printing tuple packfactor and to avoid zero division
Diffstat (limited to 'Demo/sgi')
-rwxr-xr-xDemo/sgi/video/Vinfo.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/Demo/sgi/video/Vinfo.py b/Demo/sgi/video/Vinfo.py
index 77ae3a3..8d163a1 100755
--- a/Demo/sgi/video/Vinfo.py
+++ b/Demo/sgi/video/Vinfo.py
@@ -87,12 +87,18 @@ def process(filename):
print string.ljust(vin.format, 8),
print string.rjust(`vin.width`, 4),
print string.rjust(`vin.height`, 4),
- s = string.rjust(`vin.packfactor`, 2)
- if vin.packfactor and vin.format not in ('rgb', 'jpeg') and \
- (vin.width/vin.packfactor) % 4 <> 0:
- s = s + '!'
+ if type(vin.packfactor) == type(()):
+ xpf, ypf = vin.packfactor
+ s = string.rjust(`xpf`, 2) + ',' + \
+ string.rjust(`ypf`, 2)
else:
- s = s + ' '
+ s = string.rjust(`vin.packfactor`, 2)
+ if type(vin.packfactor) == type(0) and \
+ vin.format not in ('rgb', 'jpeg') and \
+ (vin.width/vin.packfactor) % 4 <> 0:
+ s = s + '! '
+ else:
+ s = s + ' '
print s,
sys.stdout.flush()
else:
@@ -144,7 +150,8 @@ def process(filename):
if terse:
print string.rjust(`n`, 6),
- print string.rjust(`int(n*10000.0/t)*0.1`, 5)
+ if t: print string.rjust(`int(n*10000.0/t)*0.1`, 5),
+ print
else:
print 'Total', n, 'frames in', t*0.001, 'sec.',
if t: print '-- average', int(n*10000.0/t)*0.1, 'frames/sec',