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

All Samples(7)  |  Call(3)  |  Derive(0)  |  Import(4)
Return true iff every character in s is a printing ascii character.
If allowISO is true, also permit characters between 0x80 and 0xFF.

        def isPrintingAscii(s,allowISO=0):
    """Return true iff every character in s is a printing ascii character.
       If allowISO is true, also permit characters between 0x80 and 0xFF."""
    if allowISO:
        return len(s.translate(_ALLCHARS, _P_ASCII_CHARS_HIGH)) == 0
    else:
        return len(s.translate(_ALLCHARS, _P_ASCII_CHARS)) == 0
        


src/m/i/mixminion-HEAD/lib/mixminion/ClientMain.py   mixminion(Download)
import mixminion.MMTPClient
 
from mixminion.Common import LOG, Lockfile, LockfileLocked, MixError, \
     MixFatalError, MixProtocolBadAuth, MixProtocolError, STATUS, UIError, \
     UsageError, createPrivateDir, englishSequence, floorDiv, formatTime, \
        if isatty and not force:
            for p in results:
                if not isPrintingAscii(p,allowISO=1):
                    raise UIError("Not writing binary message to terminal: Use -F to do it anyway.")
        if foundAFragment:

src/m/i/mixminion-HEAD/lib/mixminion/Config.py   mixminion(Download)
import mixminion.NetUtils
 
from mixminion.Common import MixError, LOG, ceilDiv, englishSequence, \
     formatBase64, isPrintingAscii, stripSpace, stringContains, UIError
 
 
    # Make sure all characters in the file are ASCII.
    if not isPrintingAscii(contents):
        raise ConfigError("Invalid characters in file")
 
 
    # Make sure all characters in the file are ASCII.
    if not isPrintingAscii(contents):
        raise ConfigError("Invalid characters in file")
 

src/m/i/mixminion-HEAD/lib/mixminion/server/Modules.py   mixminion(Download)
import mixminion.server.PacketHandler
from mixminion.Config import ConfigError
from mixminion.Common import LOG, MixError, ceilDiv, createPrivateDir, \
     encodeBase64, floorDiv, isPrintingAscii, isSMTPMailbox, previousMidnight,\
     readFile, waitForChildren

src/m/i/mixminion-HEAD/lib/mixminion/server/PacketHandler.py   mixminion(Download)
 
from mixminion.ServerInfo import PACKET_KEY_BYTES
from mixminion.Common import MixError, MixFatalError, isPrintingAscii
 
__all__ = [ 'PacketHandler', 'ContentError', 'DeliveryPacket', 'RelayedPacket']