From 0e9f149edb11e81cb52d8fd09909fb3bfbf89028 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 22 Dec 2010 15:08:59 +0530 Subject: [PATCH] to32 should start with capital letter or number --- ox/format.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ox/format.py b/ox/format.py index c6d997f..5bf7493 100644 --- a/ox/format.py +++ b/ox/format.py @@ -16,25 +16,22 @@ def to32(q): '0' >>> to32(347485647) - 'aBcDeF' + 'AbCdEf' >>> to32(555306645) - 'gHjKmN' - - >>> to32(555306645) - 'gHjKmN' + 'GhJkMn' >>> to32(800197332334559L) - 'pQrStVwXyZ' + 'PqRsTvWxYz' >>> to32(32) '10' >>> to32(119292) - '3MfW' + '3mFw' >>> to32(939387374) - 'vZvTfE' + 'VzVtFe' >>> to32(-1) Traceback (most recent call last): @@ -45,7 +42,7 @@ def to32(q): if q < 0: raise ValueError, "must supply a positive integer" letters = "0123456789ABCDEFGHJKMNPQRSTVWXYZ" converted = [] - upper = True + upper = False while q != 0: q, r = divmod(q, 32) l = letters[r]