[reportlab-users] Patch to reportlab/lib/units.py

Paul McNett p at ulmcnett.com
Wed Feb 16 19:25:14 EST 2005


Hi,

I tried to find the appropriate place to submit patches to, but failed. 
Anyway, this fixes a small slicing problem in units.py:

Index: units.py
===================================================================
--- units.py	(revision 2523)
+++ units.py	(working copy)
@@ -17,7 +17,7 @@
          if s[-2:]=='pt': return float(s[:-2])
          if s[-1:]=='i': return float(s[:-1])*inch
          if s[-2:]=='mm': return float(s[:-2])*mm
-        if s[-4:]=='pica': return float(s[:-2])*pica
+        if s[-4:]=='pica': return float(s[:-4])*pica
          return float(s)
      except:
-        raise ValueError, "Can't convert '%s' to length" % s
\ No newline at end of file
+        raise ValueError, "Can't convert '%s' to length" % s

-- 
pkm ~ http://paulmcnett.com
-------------- next part --------------
Index: units.py
===================================================================
--- units.py	(revision 2523)
+++ units.py	(working copy)
@@ -17,7 +17,7 @@
         if s[-2:]=='pt': return float(s[:-2])
         if s[-1:]=='i': return float(s[:-1])*inch
         if s[-2:]=='mm': return float(s[:-2])*mm
-        if s[-4:]=='pica': return float(s[:-2])*pica
+        if s[-4:]=='pica': return float(s[:-4])*pica
         return float(s)
     except:
-        raise ValueError, "Can't convert '%s' to length" % s
\ No newline at end of file
+        raise ValueError, "Can't convert '%s' to length" % s


More information about the reportlab-users mailing list