Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
makeunicodedata.Array Class Reference

List of all members.

Public Member Functions

def __init__
def dump

Public Attributes

 name
 data

Detailed Description

Definition at line 1061 of file makeunicodedata.py.


Constructor & Destructor Documentation

def makeunicodedata.Array.__init__ (   self,
  name,
  data 
)

Definition at line 1063 of file makeunicodedata.py.

01063 
01064     def __init__(self, name, data):
01065         self.name = name
01066         self.data = data


Member Function Documentation

def makeunicodedata.Array.dump (   self,
  file,
  trace = 0 
)

Definition at line 1067 of file makeunicodedata.py.

01067 
01068     def dump(self, file, trace=0):
01069         # write data to file, as a C array
01070         size = getsize(self.data)
01071         if trace:
01072             print(self.name+":", size*len(self.data), "bytes", file=sys.stderr)
01073         file.write("static ")
01074         if size == 1:
01075             file.write("unsigned char")
01076         elif size == 2:
01077             file.write("unsigned short")
01078         else:
01079             file.write("unsigned int")
01080         file.write(" " + self.name + "[] = {\n")
01081         if self.data:
01082             s = "    "
01083             for item in self.data:
01084                 i = str(item) + ", "
01085                 if len(s) + len(i) > 78:
01086                     file.write(s + "\n")
01087                     s = "    " + i
01088                 else:
01089                     s = s + i
01090             if s.strip():
01091                 file.write(s + "\n")
01092         file.write("};\n\n")

Here is the call graph for this function:


Member Data Documentation

Definition at line 1065 of file makeunicodedata.py.

Definition at line 1064 of file makeunicodedata.py.


The documentation for this class was generated from the following file: