Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(21)  |  Call(14)  |  Derive(0)  |  Import(7)

            def isBytes(v):
        return isinstance(v, str)
        


src/r/e/reportlab-3.1.8/src/reportlab/pdfbase/pdfdoc.py   reportlab(Download)
from reportlab.pdfbase import pdfutils
from reportlab import rl_config
from reportlab.lib.utils import import_zlib, open_for_read, makeFileName, isSeq, isBytes, isUnicode, _digester, isStr, bytestr, isPy3
from reportlab.lib.rl_accel import escapePDF, fp_str, asciiBase85Encode, asciiBase85Decode
from reportlab.pdfbase import pdfmetrics
        #instead of str, so Jython/Python etc do not differ
        return pdfdocEnc(fp_str(element))
    elif isBytes(element):
        return element
    elif isUnicode(element):
    def format(self, document):
        s = self.s
        enc = getattr(self,'enc','auto')
        if (isBytes(s)):
            if enc is 'auto':

src/r/e/reportlab-3.1.8/src/reportlab/platypus/paragraph.py   reportlab(Download)
from reportlab.rl_config import platypus_link_underline
from reportlab import rl_config
from reportlab.lib.utils import _className, isBytes, unicodeT, bytesT, strTypes
from reportlab.lib.rl_accel import sameFrag
import re
def split(text, delim=None):
    if isBytes(text): text = text.decode('utf8')
    if delim is not None and isBytes(delim): delim = delim.decode('utf8')
    return [uword for uword in (_wsc_re_split(text) if delim is None and u'\xa0' in text else text.split(delim))]
 
def strip(text):
    if isBytes(text): text = text.decode('utf8')
def _nbspCount(w):
    if isBytes(w):
        return w.count(b'\xc2\xa0')
    else:
        return w.count(u'\xa0')

src/r/e/reportlab-3.1.8/src/reportlab/graphics/renderSVG.py   reportlab(Download)
from reportlab.graphics.shapes import * # (only for test0)
from reportlab import rl_config
from reportlab.lib.utils import getBytesIO, RLString, isPy3, isUnicode, isBytes
 
from xml.dom import getDOMImplementation
    def write(self,u):
        if isBytes(u):
            try:
                 u = u.decode('utf-8')
            except:

src/r/e/reportlab-3.1.8/src/reportlab/lib/validators.py   reportlab(Download)
 
import sys, codecs
from reportlab.lib.utils import isSeq, isBytes, isStr, isPy3
from reportlab.lib import colors
 
        def normalize(self,x):
            return int(x.decode('utf8') if isBytes(x) else x)
 
class _isNumberOrNone(_isNumber):
    def test(self,x):

src/r/e/reportlab-3.1.8/src/reportlab/pdfbase/cidfonts.py   reportlab(Download)
from reportlab.lib.rl_accel import escapePDF
from reportlab.rl_config import CMapSearchPath
from reportlab.lib.utils import isSeq, isBytes
 
#quick hackery for 2.0 release.  Now we always do unicode, and have built in
    def formatForPdf(self, text):
        #these ones should be encoded asUTF16 minus the BOM
        from codecs import utf_16_be_encode
        #print 'formatting %s: %s' % (type(text), repr(text))
        if isBytes(text):
    def stringWidth(self, text, size, encoding=None):
        "Just ensure we do width test on characters, not bytes..."
        if isBytes(text):
            text = text.decode('utf8')
 

src/r/e/reportlab-3.1.8/src/reportlab/pdfgen/textobject.py   reportlab(Download)
from types import *
from reportlab.lib.colors import Color, CMYKColor, CMYKColorSep, toColor, black, white, _CMYK_black, _CMYK_white
from reportlab.lib.utils import isBytes, isStr, asUnicode
from reportlab.lib.rl_accel import fp_str
from reportlab.pdfbase import pdfmetrics
            #convert to T1  coding
            fc = font
            if isBytes(text):
                try:
                    text = text.decode('utf8')

src/r/e/reportlab-3.1.8/src/reportlab/lib/rl_accel.py   reportlab(Download)
 
if _py_funcs:
    from reportlab.lib.utils import isBytes, isUnicode, isSeq, isPy3, rawBytes, asNative, asUnicode, asBytes
    from math import log
    from struct import unpack