src/reportlab/pdfbase/pdfutils.py
branchpy33
changeset 3731 b233dd0577ff
parent 3723 99aa837b6703
child 3765 a7e7cd6e0003
--- a/src/reportlab/pdfbase/pdfutils.py	Thu Mar 07 17:54:44 2013 +0000
+++ b/src/reportlab/pdfbase/pdfutils.py	Wed May 01 16:43:09 2013 +0100
@@ -10,7 +10,7 @@
 import os
 import binascii
 from reportlab import rl_config
-from reportlab.lib.utils import getBytesIO, ImageReader, isStrType, isUnicodeType, isPython3
+from reportlab.lib.utils import getBytesIO, ImageReader, isStr, isUnicode, isPython3
 
 LINEEND = '\015\012'
 
@@ -192,7 +192,7 @@
     This is a verbose encoding used for binary data within
     a PDF file.  One byte binary becomes two bytes of ASCII.
     Helper function used by images."""
-    if isUnicodeType(input):
+    if isUnicode(input):
         input = input.encode('utf-8')
     output = getBytesIO()
     output.write(binascii.b2a_hex(input))
@@ -206,7 +206,7 @@
     Not used except to provide a test of the inverse function."""
 
     #strip out all whitespace
-    if not isStrType(input):
+    if not isStr(input):
         input = input.decode('utf-8')
     stripped = ''.join(input.split())
     assert stripped[-1] == '>', 'Invalid terminator for Ascii Hex Stream'
@@ -226,7 +226,7 @@
         whole_word_count, remainder_size = divmod(len(input), 4)
         cut = 4 * whole_word_count
         body, lastbit = input[0:cut], input[cut:]
-        if isPython3 and isStrType(lastbit):
+        if isPython3 and isStr(lastbit):
             lastbit = lastbit.encode('utf-8')
 
         out = [].append
@@ -236,10 +236,10 @@
             b2 = body[offset+1]
             b3 = body[offset+2]
             b4 = body[offset+3]
-            if isStrType(b1): b1 = ord(b1)
-            if isStrType(b2): b2 = ord(b2)
-            if isStrType(b3): b3 = ord(b3)
-            if isStrType(b4): b4 = ord(b4)
+            if isStr(b1): b1 = ord(b1)
+            if isStr(b2): b2 = ord(b2)
+            if isStr(b3): b3 = ord(b3)
+            if isStr(b4): b4 = ord(b4)
 
             if b1<128:
                 num = (((((b1<<8)|b2)<<8)|b3)<<8)|b4
@@ -274,10 +274,10 @@
             b2 = lastbit[1]
             b3 = lastbit[2]
             b4 = lastbit[3]
-            if isStrType(b1): b1 = ord(b1)
-            if isStrType(b2): b2 = ord(b2)
-            if isStrType(b3): b3 = ord(b3)
-            if isStrType(b4): b4 = ord(b4)
+            if isStr(b1): b1 = ord(b1)
+            if isStr(b2): b2 = ord(b2)
+            if isStr(b3): b3 = ord(b3)
+            if isStr(b4): b4 = ord(b4)
 
             num = 16777216 * b1 + 65536 * b2 + 256 * b3 + b4