]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Tools/framer/framer/member.py
1 from framer
import template
2 from framer
.util
import cstring
, unindent
16 T_STRING_INPLACE
= "T_STRING_INPLACE"
17 T_OBJECT_EX
= "T_OBJECT_EX"
19 RO
= READONLY
= "READONLY"
20 READ_RESTRICTED
= "READ_RESTRICTED"
21 WRITE_RESTRICTED
= "WRITE_RESTRICTED"
22 RESTRICT
= "RESTRICTED"
25 "unsigned int" : T_UINT
,
27 "unsigned long" : T_LONG
,
31 "PyObject *" : T_OBJECT
,
36 def __init__(self
, cname
=None, type=None, flags
=None, doc
=None):
44 def register(self
, name
, struct
):
51 v
["PythonName"] = self
.name
52 if self
.cname
is not None:
53 v
["CName"] = self
.cname
55 v
["CName"] = self
.name
56 v
["Flags"] = self
.flags
or "0"
57 v
["Type"] = self
.get_type()
58 if self
.doc
is not None:
59 v
["Docstring"] = cstring(unindent(self
.doc
))
60 v
["StructName"] = self
.struct
.name
63 """Deduce type code from struct specification if not defined"""
64 if self
.type is not None:
66 ctype
= self
.struct
.get_type(self
.name
)
71 print >> f
, template
.memberdef_def
% self
.vars
73 print >> f
, template
.memberdef_def_doc
% self
.vars