]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Track info is now two triples instead of six number
authorGuido van Rossum <guido@python.org>
Wed, 15 Apr 1992 16:20:12 +0000 (16:20 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 15 Apr 1992 16:20:12 +0000 (16:20 +0000)
Demo/sgi/cd/listcd.py

index 5017851e618995c71c45f5f295d6968673038965..2cfadb6b5ec25af4b52d1b2c7eb81fc0bc0bfc97 100755 (executable)
@@ -11,13 +11,13 @@ def main():
                except RuntimeError:
                        break
        for i in range(len(info)):
-               start_min, start_sec, start_frame, \
-                       total_min, total_sec, total_frame = info[i]
-               print 'Track', z(i+1),
-               print z(start_min) + ':' + z(start_sec) + ':' + z(start_frame),
-               print z(total_min) + ':' + z(total_sec) + ':' + z(total_frame)
+               start, total = info[i]
+               print 'Track', zfill(i+1), triple(start), triple(total)
 
-def z(n):
+def triple((a, b, c)):
+       return zfill(a) + ':' + zfill(b) + ':' + zfill(c)
+
+def zfill(n):
        s = `n`
        return '0' * (2 - len(s)) + s