Back to index

python3.2  3.2.2
Functions | Variables
curses.ascii Namespace Reference

Functions

def _ctoi
def isalnum
def isalpha
def isascii
def isblank
def iscntrl
def isdigit
def isgraph
def islower
def isprint
def ispunct
def isspace
def isupper
def isxdigit
def isctrl
def ismeta
def ascii
def ctrl
def alt
def unctrl

Variables

int NUL = 0x00
int SOH = 0x01
int STX = 0x02
int ETX = 0x03
int EOT = 0x04
int ENQ = 0x05
int ACK = 0x06
int BEL = 0x07
int BS = 0x08
int TAB = 0x09
int HT = 0x09
int LF = 0x0a
int NL = 0x0a
int VT = 0x0b
int FF = 0x0c
int CR = 0x0d
int SO = 0x0e
int SI = 0x0f
int DLE = 0x10
int DC1 = 0x11
int DC2 = 0x12
int DC3 = 0x13
int DC4 = 0x14
int NAK = 0x15
int SYN = 0x16
int ETB = 0x17
int CAN = 0x18
int EM = 0x19
int SUB = 0x1a
int ESC = 0x1b
int FS = 0x1c
int GS = 0x1d
int RS = 0x1e
int US = 0x1f
int SP = 0x20
int DEL = 0x7f
list controlnames

Detailed Description

Constants and membership tests for ASCII characters

Function Documentation

def curses.ascii._ctoi (   c) [private]

Definition at line 48 of file ascii.py.

00048 
00049 def _ctoi(c):
00050     if type(c) == type(""):
00051         return ord(c)
00052     else:
00053         return c

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.alt (   c)

Definition at line 83 of file ascii.py.

00083 
00084 def alt(c):
00085     if type(c) == type(""):
00086         return chr(_ctoi(c) | 0x80)
00087     else:
00088         return _ctoi(c) | 0x80

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.ascii (   c)

Definition at line 71 of file ascii.py.

00071 
00072 def ascii(c):
00073     if type(c) == type(""):
00074         return chr(_ctoi(c) & 0x7f)
00075     else:
00076         return _ctoi(c) & 0x7f

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.ctrl (   c)

Definition at line 77 of file ascii.py.

00077 
00078 def ctrl(c):
00079     if type(c) == type(""):
00080         return chr(_ctoi(c) & 0x1f)
00081     else:
00082         return _ctoi(c) & 0x1f

Here is the call graph for this function:

def curses.ascii.isalnum (   c)

Definition at line 54 of file ascii.py.

00054 
def isalnum(c): return isalpha(c) or isdigit(c)

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.isalpha (   c)

Definition at line 55 of file ascii.py.

00055 
def isalpha(c): return isupper(c) or islower(c)

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.isascii (   c)

Definition at line 56 of file ascii.py.

00056 
def isascii(c): return _ctoi(c) <= 127          # ?
def curses.ascii.isblank (   c)

Definition at line 57 of file ascii.py.

00057 
def isblank(c): return _ctoi(c) in (8,32)
def curses.ascii.iscntrl (   c)

Definition at line 58 of file ascii.py.

00058 
def iscntrl(c): return _ctoi(c) <= 31
def curses.ascii.isctrl (   c)

Definition at line 68 of file ascii.py.

00068 
def isctrl(c): return _ctoi(c) < 32
def curses.ascii.isdigit (   c)

Definition at line 59 of file ascii.py.

00059 
def isdigit(c): return _ctoi(c) >= 48 and _ctoi(c) <= 57

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.isgraph (   c)

Definition at line 60 of file ascii.py.

00060 
def isgraph(c): return _ctoi(c) >= 33 and _ctoi(c) <= 126

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.islower (   c)

Definition at line 61 of file ascii.py.

00061 
def islower(c): return _ctoi(c) >= 97 and _ctoi(c) <= 122

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.ismeta (   c)

Definition at line 69 of file ascii.py.

00069 
00070 def ismeta(c): return _ctoi(c) > 127

def curses.ascii.isprint (   c)

Definition at line 62 of file ascii.py.

00062 
def isprint(c): return _ctoi(c) >= 32 and _ctoi(c) <= 126

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.ispunct (   c)

Definition at line 63 of file ascii.py.

00063 
def ispunct(c): return _ctoi(c) != 32 and not isalnum(c)

Here is the call graph for this function:

def curses.ascii.isspace (   c)

Definition at line 64 of file ascii.py.

00064 
def isspace(c): return _ctoi(c) in (9, 10, 11, 12, 13, 32)

Here is the caller graph for this function:

def curses.ascii.isupper (   c)

Definition at line 65 of file ascii.py.

00065 
def isupper(c): return _ctoi(c) >= 65 and _ctoi(c) <= 90

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.isxdigit (   c)

Definition at line 66 of file ascii.py.

00066 
00067 def isxdigit(c): return isdigit(c) or \
    (_ctoi(c) >= 65 and _ctoi(c) <= 70) or (_ctoi(c) >= 97 and _ctoi(c) <= 102)

Here is the call graph for this function:

Here is the caller graph for this function:

def curses.ascii.unctrl (   c)

Definition at line 89 of file ascii.py.

00089 
00090 def unctrl(c):
00091     bits = _ctoi(c)
00092     if bits == 0x7f:
00093         rep = "^?"
00094     elif isprint(bits & 0x7f):
00095         rep = chr(bits & 0x7f)
00096     else:
00097         rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20)
00098     if bits & 0x80:
00099         return "!" + rep
00100     return rep

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 9 of file ascii.py.

Definition at line 10 of file ascii.py.

Definition at line 11 of file ascii.py.

Definition at line 29 of file ascii.py.

Initial value:
00001 [
00002 "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
00003 "BS",  "HT",  "LF",  "VT",  "FF",  "CR",  "SO",  "SI",
00004 "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
00005 "CAN", "EM",  "SUB", "ESC", "FS",  "GS",  "RS",  "US",
00006 "SP"
00007 ]

Definition at line 40 of file ascii.py.

Definition at line 18 of file ascii.py.

Definition at line 22 of file ascii.py.

Definition at line 23 of file ascii.py.

Definition at line 24 of file ascii.py.

Definition at line 25 of file ascii.py.

Definition at line 38 of file ascii.py.

Definition at line 21 of file ascii.py.

Definition at line 30 of file ascii.py.

Definition at line 8 of file ascii.py.

Definition at line 7 of file ascii.py.

Definition at line 32 of file ascii.py.

Definition at line 28 of file ascii.py.

Definition at line 6 of file ascii.py.

Definition at line 17 of file ascii.py.

Definition at line 33 of file ascii.py.

Definition at line 34 of file ascii.py.

Definition at line 13 of file ascii.py.

Definition at line 14 of file ascii.py.

Definition at line 26 of file ascii.py.

Definition at line 15 of file ascii.py.

Definition at line 3 of file ascii.py.

Definition at line 35 of file ascii.py.

Definition at line 20 of file ascii.py.

Definition at line 19 of file ascii.py.

Definition at line 4 of file ascii.py.

Definition at line 37 of file ascii.py.

Definition at line 5 of file ascii.py.

Definition at line 31 of file ascii.py.

Definition at line 27 of file ascii.py.

Definition at line 12 of file ascii.py.

Definition at line 36 of file ascii.py.

Definition at line 16 of file ascii.py.