rename utils.py UniChr --> uniChr py33
authorrobin
Thu, 16 Jan 2014 17:02:25 +0000
branchpy33
changeset 4004 ebd460ef8d2f
parent 4003 623f585f5fbc
child 4005 b7dee7fcd927
rename utils.py UniChr --> uniChr
src/reportlab/lib/utils.py
src/reportlab/platypus/paraparser.py
tests/test_pdfbase_ttfonts.py
tools/pythonpoint/stdparser.py
--- a/src/reportlab/lib/utils.py	Thu Jan 16 17:00:58 2014 +0000
+++ b/src/reportlab/lib/utils.py	Thu Jan 16 17:02:25 2014 +0000
@@ -57,7 +57,7 @@
     def asNative(v):
         return asUnicode(v)
 
-    UniChr = chr
+    uniChr = chr
 
     def int2Byte(i):
         return bytes([i])
@@ -151,7 +151,7 @@
     def asNative(v):
         return asBytes(v)
 
-    def UniChr(v):
+    def uniChr(v):
         return unichr(v)
 
     def isStr(v):
--- a/src/reportlab/platypus/paraparser.py	Thu Jan 16 17:00:58 2014 +0000
+++ b/src/reportlab/platypus/paraparser.py	Thu Jan 16 17:02:25 2014 +0000
@@ -19,7 +19,7 @@
 import reportlab.lib.sequencer
 
 from reportlab.lib.abag import ABag
-from reportlab.lib.utils import ImageReader, isPy3, annotateException, encode_label, asUnicode, asBytes, UniChr
+from reportlab.lib.utils import ImageReader, isPy3, annotateException, encode_label, asUnicode, asBytes, uniChr
 from reportlab.lib.colors import toColor, white, black, red, Color
 from reportlab.lib.fonts import tt2ps, ps2tt
 from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
@@ -489,7 +489,7 @@
     'zwnj': u'\u200c',
     }
 
-known_entities = dict([(k,UniChr(v)) for k,v in name2codepoint.items()])
+known_entities = dict([(k,uniChr(v)) for k,v in name2codepoint.items()])
 for k in greeks:
     if k not in known_entities:
         known_entities[k] = greeks[k]
@@ -726,7 +726,7 @@
         except ValueError:
             self.unknown_charref(name)
             return
-        self.handle_data(UniChr(n))   #.encode('utf8'))
+        self.handle_data(uniChr(n))   #.encode('utf8'))
 
     def syntax_error(self,lineno,message):
         self._syntax_error(message)
--- a/tests/test_pdfbase_ttfonts.py	Thu Jan 16 17:00:58 2014 +0000
+++ b/tests/test_pdfbase_ttfonts.py	Thu Jan 16 17:02:25 2014 +0000
@@ -17,11 +17,11 @@
                                       FF_SYMBOLIC, FF_NONSYMBOLIC, \
                                       calcChecksum, add32
 from reportlab import rl_config
-from reportlab.lib.utils import getBytesIO, isPy3, UniChr, int2Byte
+from reportlab.lib.utils import getBytesIO, isPy3, uniChr, int2Byte
 
 def utf8(code):
     "Convert a given UCS character index into UTF-8"
-    return UniChr(code).encode('utf8')
+    return uniChr(code).encode('utf8')
 
 def _simple_subset_generation(fn,npages,alter=0):
     c = Canvas(outputfile(fn))
--- a/tools/pythonpoint/stdparser.py	Thu Jan 16 17:00:58 2014 +0000
+++ b/tools/pythonpoint/stdparser.py	Thu Jan 16 17:02:25 2014 +0000
@@ -8,7 +8,7 @@
 """
 
 import string, imp, sys, os, copy
-from reportlab.lib.utils import isSeq, UniChr, isPy3
+from reportlab.lib.utils import isSeq, uniChr, isPy3
 from reportlab.lib import colors
 from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
 from reportlab.lib.utils import recursiveImport
@@ -816,7 +816,7 @@
         except ValueError:
             self.unknown_charref(name)
             return
-        self.handle_data(UniChr(n).encode('utf8'))
+        self.handle_data(uniChr(n).encode('utf8'))
 
     #HTMLParser interface
     def handle_starttag(self, tag, attrs):
@@ -855,7 +855,7 @@
     def handle_entityref(self, name):
         "Handles a named entity.  "
         try:
-            v = UniChr(known_entities[name])
+            v = uniChr(known_entities[name])
         except:
             v = u'&%s;' % name
         self.handle_data(v)