本文整理汇总了Python中strFunctions.cap函数的典型用法代码示例。如果您正苦于以下问题:Python cap函数的具体用法?Python cap怎么用?Python cap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: writeLocal
def writeLocal(fileOut, name, classes):
capName = name.upper()
fileOut.write('#ifdef USE_{0}\n\n'.format(capName))
fileOut.write('SBMLCONSTRUCTOR_EXCEPTION({0}PkgNamespaces)\n'.format(strFunctions.cap(name)))
for i in range (0, len(classes)):
if classes[i]['typecode'] != 'HACK':
fileOut.write('SBMLCONSTRUCTOR_EXCEPTION({0})\n'.format(classes[i]['name']))
for i in range (0, len(classes)):
if (classes[i]['hasListOf'] == True):
loName = strFunctions.listOfName(classes[i]['name'])
fileOut.write('SBMLCONSTRUCTOR_EXCEPTION({0})\n'.format(strFunctions.cap(loName)))
fileOut.write('\n')
for i in range (0, len(classes)):
if (classes[i]['abstract'] == True or isBaseClassForOthers(classes[i], classes)):
fileOut.write('/**\n')
fileOut.write(' * Convert {0} objects into the most specific object possible.\n'.format(classes[i]['name']))
fileOut.write(' */\n')
fileOut.write('%typemap(out) {0}*\n'.format(classes[i]['name']))
fileOut.write('{\n')
fileOut.write(' $result = SWIG_NewPointerObj($1, GetDowncastSwigTypeForPackage($1, "{0}"), $owner | %newpointer_flags);\n'.format(name))
fileOut.write('}\n')
fileOut.write('\n')
fileOut.write('\n')
fileOut.write('#endif // USE_{0} \n\n'.format(capName))
示例2: parseAttribute
def parseAttribute(attrib):
attName = attrib['name']
capAttName = strFunctions.cap(attName)
reqd = attrib['reqd']
if attrib['type'] == 'SId':
attType = 'string'
attTypeCode = 'std::string&'
num = False
elif attrib['type'] == 'SIdRef':
attType = 'string'
attTypeCode = 'std::string&'
num = False
elif attrib['type'] == 'UnitSIdRef':
attType = 'string'
attTypeCode = 'std::string&'
num = False
elif attrib['type'] == 'UnitSId':
attType = 'string'
attTypeCode = 'std::string&'
num = False
elif attrib['type'] == 'string':
attType = 'string'
attTypeCode = 'std::string&'
num = False
elif attrib['type'] == 'double':
attType = 'double'
attTypeCode = 'double'
num = True
elif attrib['type'] == 'int':
attType = 'integer'
attTypeCode = 'int'
num = True
elif attrib['type'] == 'uint':
attType = 'unsigned integer'
attTypeCode = 'unsigned int'
num = True
elif attrib['type'] == 'bool':
attType = 'boolean'
attTypeCode = 'bool'
num = False
elif attrib['type'] == 'element':
attType = 'element'
if attrib['name'] == 'math' or attrib['name'] == 'Math':
attTypeCode = 'ASTNode*'
else:
#attTypeCode = 'element-not-done'
if attrib.has_key('element'):
attTypeCode = '{0}*'.format(attrib['element'])
else:
attTypeCode = '{0}*'.format(strFunctions.cap(attrib['name']))
num = False
elif attrib['type'] == 'lo_element':
attType = 'lo_element'
attTypeCode = attrib['element']
num = False
else:
attType = 'FIX ME'
attTypeCode = 'FIX ME'
num = False
return [attName, capAttName, attType, attTypeCode, num, reqd]
示例3: writePlugins
def writePlugins(fileOut, name, plugins):
capName = name.upper()
fileOut.write('#ifdef USE_{0}\n'.format(capName))
fileOut.write('if (pkgName == "{0}")\n'.format(name))
fileOut.write('{\n')
for i in range (0, len(plugins)):
plugin = plugins[i]
if (i == 0):
fileOut.write(' if ')
else:
fileOut.write(' else if ')
typecode = 'SBML_{0}'.format(createSBase(plugin['sbase'].upper()))
if plugin.has_key('typecode') and plugin['typecode'] != None:
typecode = plugin['typecode']
fileOut.write('(sb->getTypeCode() == {0})\n'.format(typecode))
fileOut.write(' {\n')
if typecode != 'SBML_LIST_OF':
fileOut.write(' return SWIGTYPE_p_{0}{1}Plugin;\n'.format(strFunctions.cap(name), plugin['sbase']))
else:
fileOut.write(' std::string name = sb->getElementName();\n')
fileOut.write(' if(name == "{0}")\n'.format(strFunctions.lowerFirst(plugin['sbase'])))
fileOut.write(' return SWIGTYPE_p_{0}{1}Plugin;\n'.format(strFunctions.cap(name), plugin['sbase']))
fileOut.write(' }\n')
fileOut.write('}\n')
fileOut.write('\n')
fileOut.write('#endif // USE_{0} \n\n'.format(capName))
示例4: writeCreateObject
def writeCreateObject(outFile, element, sbmltypecode, attribs, isSedListOf, hasChildren=False, hasMath=False,baseClass='SedBase'):
if (isSedListOf == True or hasChildren == False) and baseClass == 'SedBase':
return;
outFile.write('/**\n')
outFile.write(' * return the SEDML object corresponding to next XMLToken.\n')
outFile.write(' */\n')
outFile.write('SedBase*\n{0}::createObject(XMLInputStream& stream)\n'.format(element))
outFile.write('{\n')
if baseClass == 'SedBase':
outFile.write('\tSedBase* object = NULL;\n\n')
else:
outFile.write('\tSedBase* object = {0}::createObject(stream);\n\n'.format(baseClass))
if hasChildren or hasMath:
outFile.write('\tconst string& name = stream.peek().getName();\n\n')
for i in range (0, len(attribs)):
current = attribs[i]
if current.has_key('lo_elementName'):
outFile.write('\tif (name == "{0}")\n'.format(current['lo_elementName']))
outFile.write('\t{\n')
outFile.write('\t\tobject = &m{0};\n'.format(strFunctions.capp(current['name'])))
outFile.write('\t}\n\n')
elif current['type'] == 'lo_element':
outFile.write('\tif (name == "listOf{0}")\n'.format(strFunctions.capp(current['name'])))
outFile.write('\t{\n')
outFile.write('\t\tobject = &m{0};\n'.format(strFunctions.capp(current['name'])))
outFile.write('\t}\n\n')
elif current['type'] == 'element' and (current['name'] !='Math' and current['name'] != 'math'):
outFile.write('\tif (name == "{0}")\n'.format(current['name']))
outFile.write('\t{\n')
outFile.write('\t\tm{0}= new {1}();\n'.format(strFunctions.cap(current['name']), current['element']))
outFile.write('\t\tobject = m{0};\n'.format(strFunctions.cap(current['name'])))
outFile.write('\t}\n\n')
outFile.write('\tconnectToChild();\n\n')
outFile.write('\treturn object;\n')
outFile.write('}\n\n\n')
示例5: writeCopyAttributes
def writeCopyAttributes(attrs, output, tabs, name):
for i in range(0, len(attrs)):
attName = strFunctions.cap(attrs[i]['name'])
atttype = attrs[i]['type']
if atttype == 'array':
output.write('{0}m{1} = NULL;\n'.format(tabs, attName, name))
output.write('{0}set{1}({2}.m{1}, {2}.m{1}Length);\n'.format(tabs, attName, name))
elif atttype != 'lo_element' and atttype != 'inline_lo_element':
if atttype != 'element':
output.write('{0}m{1} = {2}.m{1};\n'.format(tabs, attName, name))
else:
output.write('{0}if ({2}.m{1} != NULL)\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
output.write('{0}'.format(tabs))
output.write('{\n')
if attrs[i]['name'] != 'math':
output.write('{0} m{1} = {2}.m{1}->clone();\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
else:
output.write('{0} m{1} = {2}.m{1}->deepCopy();\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
output.write('{0}'.format(tabs))
output.write('}\n')
output.write('{0}else\n'.format(tabs))
output.write('{0}'.format(tabs))
output.write('{\n')
output.write('{0} m{1} = NULL;\n'.format(tabs, strFunctions.cap(attrs[i]['name'])))
output.write('{0}'.format(tabs))
output.write('}\n')
else:
if attName.endswith('x'):
output.write('{0}m{1}es = {2}.m{1}es;\n'.format(tabs, attName, name))
elif attName.endswith('s'):
output.write('{0}m{1} = {2}.m{1};\n'.format(tabs, attName, name))
else:
output.write('{0}m{1}s = {2}.m{1}s;\n'.format(tabs, attName, name))
if atttype == 'double' or atttype == 'int' or atttype == 'uint' or atttype == 'bool':
output.write('{0}mIsSet{1} = {2}.mIsSet{1};\n'.format(tabs, attName, name))
示例6: writeWriteElementsCPPCode
def writeWriteElementsCPPCode(outFile, element, attributes, hasChildren=False, hasMath=False, baseClass='SedBase'):
writeInternalStart(outFile)
outFile.write('/*\n')
outFile.write(' * write contained elements\n')
outFile.write(' */\n')
outFile.write('void\n{0}::writeElements (XMLOutputStream& stream) const\n'.format(element))
outFile.write('{\n')
outFile.write('\t{0}::writeElements(stream);\n'.format(baseClass))
if hasChildren == True:
for i in range(0, len(attributes)):
if attributes[i]['type'] == 'element' and (attributes[i]['name'] != 'Math' and attributes[i]['name'] != 'math'):
outFile.write('\tif (isSet{0}() == true)\n'.format(strFunctions.cap(attributes[i]['name'])))
outFile.write('\t{\n\t\t')
outFile.write('m{0}->write(stream);'.format(strFunctions.cap(attributes[i]['name'])))
outFile.write('\n\t}\n')
if attributes[i]['type'] == 'lo_element':
outFile.write('\tif (getNum{0}s() > 0)\n'.format(strFunctions.cap(attributes[i]['name'])))
outFile.write('\t{\n\t\t')
outFile.write('m{0}.write(stream);'.format(strFunctions.cap(attributes[i]['name'])))
outFile.write('\n\t}\n')
if hasMath == True:
for i in range(0, len(attributes)):
if attributes[i]['type'] == 'element' and attributes[i]['name'] == 'Math' or attributes[i]['name'] == 'math':
outFile.write('\tif (isSet{0}() == true)\n'.format('Math'))
outFile.write('\t{\n\t\twriteMathML(getMath(), stream, NULL);\n\t}\n')
outFile.write('}\n\n\n')
writeInternalEnd(outFile)
示例7: writeCopyAttributes
def writeCopyAttributes(attrs, output, tabs, name):
for i in range(0, len(attrs)):
attName = strFunctions.cap(attrs[i]['name'])
atttype = attrs[i]['type']
if atttype == 'element' and attName == 'Math':
output.write('{0}m{1} = {2}.m{1} != NULL ? {2}.m{1}->deepCopy() : NULL;\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
else:
output.write('{0}m{1} = {2}.m{1};\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
if atttype == 'double' or atttype == 'int' or atttype == 'uint' or atttype == 'bool':
output.write('{0}mIsSet{1} = {2}.mIsSet{1};\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
示例8: writeReadOtherXMLCPPCode
def writeReadOtherXMLCPPCode(outFile, element, hasMath = True, attribs = None, baseClass='SedBase'):
writeInternalStart(outFile)
outFile.write('bool\n{0}::readOtherXML (XMLInputStream& stream)\n'.format(element))
outFile.write('{\n')
outFile.write(' bool read = false;\n')
outFile.write(' const string& name = stream.peek().getName();\n\n')
if hasMath == True:
outFile.write(' if (name == "math")\n {\n')
outFile.write(' const XMLToken elem = stream.peek();\n')
outFile.write(' const std::string prefix = checkMathMLNamespace(elem);\n\n')
#outFile.write(' if (stream.getSedNamespaces() == NULL)\n {\n')
#outFile.write(' stream.setSedNamespaces(new SedNamespaces(getLevel(), getVersion()));\n }\n\n')
outFile.write(' delete mMath;\n')
outFile.write(' mMath = readMathML(stream, prefix);\n')
#outFile.write(' if (mMath != NULL)\n {\n mMath->setParentSEDMLObject(this);\n }\n')
outFile.write(' read = true;\n }\n\n')
elif containsType(attribs, 'XMLNode*'):
node = getByType(attribs, 'XMLNode*')
outFile.write(' if (name == "{0}")\n'.format(node['name']))
outFile.write(' {\n')
outFile.write(' const XMLToken& token = stream.next();\n')
outFile.write(' stream.skipText();\n')
outFile.write(' m{0} = new XMLNode(stream);\n'.format(strFunctions.cap(node['name'])))
outFile.write(' stream.skipPastEnd(token);\n')
outFile.write(' read = true;\n }\n\n')
elif containsType(attribs, 'DimensionDescription*'):
node = getByType(attribs, 'DimensionDescription*')
outFile.write(' if (name == "{0}")\n'.format(node['name']))
outFile.write(' {\n')
outFile.write(' const XMLToken& token = stream.next();\n')
outFile.write(' m{0} = new DimensionDescription();\n'.format(strFunctions.cap(node['name'])))
outFile.write(' m{0}->read(stream);\n'.format(strFunctions.cap(node['name'])))
outFile.write(' stream.skipPastEnd(token);\n')
outFile.write(' read = true;\n }\n\n')
elif containsType(attribs, 'std::vector<double>'):
elem = getByType(attribs, 'std::vector<double>')
outFile.write(' while (stream.peek().getName() == "{0}")\n'.format(elem['name']))
outFile.write(' {\n')
outFile.write(' stream.next(); // consume start\n')
outFile.write(' stringstream text;\n')
outFile.write(' while(stream.isGood() && stream.peek().isText())\n')
outFile.write(' text << stream.next().getCharacters();\n')
outFile.write(' double value; text >> value;\n')
outFile.write(' if (!text.fail())\n')
outFile.write(' m{0}.push_back(value);\n'.format(strFunctions.capp(elem['name'])))
outFile.write(' stream.next(); // consume end\n')
outFile.write(' read = true;\n')
outFile.write(' }\n')
outFile.write(' if ({0}::readOtherXML(stream))\n'.format(baseClass))
outFile.write(' {\n read = true;\n }\n')
outFile.write(' return read;\n')
outFile.write('}\n\n\n')
writeInternalEnd(outFile)
示例9: writeCopyAttributes
def writeCopyAttributes(attrs, output, tabs, name):
for i in range(0, len(attrs)):
attName = strFunctions.cap(attrs[i]['name'])
atttype = attrs[i]['type']
if atttype == 'element' and attName == 'Math':
output.write('{0}m{1} = {2}.m{1} != NULL ? {2}.m{1}->deepCopy() : NULL;\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
elif atttype == 'XMLNode*' or atttype == 'DimensionDescription*':
output.write('{0}m{1} = {2}.m{1} != NULL ? {2}.m{1}->clone() : NULL;\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
else:
output.write('{0}m{1} = {2}.m{1};\n'.format(tabs, strFunctions.capp(attrs[i]['name'], atttype == 'lo_element' or atttype == 'std::vector<double>'), name))
if atttype == 'double' or atttype == 'int' or atttype == 'uint' or atttype == 'bool':
output.write('{0}mIsSet{1} = {2}.mIsSet{1};\n'.format(tabs, strFunctions.cap(attrs[i]['name']), name))
示例10: writeJavaNS
def writeJavaNS(fileOut, name):
capName = name.upper()
fileOut.write('/**\n')
fileOut.write(' * casting to most specific SBMLNamespaces object\n */\n\n')
fileOut.write('#ifdef USE_{0}\n'.format(capName))
fileOut.write('%pragma(java) modulecode =\n')
fileOut.write('%{\n')
fileOut.write(' if (ns.hasURI({0}Extension.getXmlnsL3V1V1()))\n'.format(strFunctions.cap(name)))
fileOut.write(' {\n')
fileOut.write(' return new {0}PkgNamespaces(cPtr, owner);\n'.format(strFunctions.cap(name)))
fileOut.write(' }\n')
fileOut.write('%}\n')
fileOut.write('#endif /* USE_{0} */\n\n'.format(capName))
示例11: writeAtt
def writeAtt(atttype, name, output, constType, pkg):
if atttype == 'SId' or atttype == 'SIdRef' or atttype == 'UnitSId' or atttype == 'UnitSIdRef' or atttype == 'string':
output.write('\t, m{0} ("")\n'.format(strFunctions.cap(name)))
elif atttype == 'element' or atttype == 'XMLNode*':
output.write('\t, m{0} (NULL)\n'.format(strFunctions.cap(name)))
elif atttype == 'lo_element':
output.write('\t, m{0} ('.format(strFunctions.capp(name)))
if constType == 0:
output.write(')\n')
elif constType == 1:
output.write('level, version)\n')
elif constType == 2:
output.write('{0}ns)\n'.format(pkg))
elif atttype == 'double':
output.write('\t, m{0} (numeric_limits<double>::quiet_NaN())\n'.format(strFunctions.cap(name)))
output.write('\t, mIsSet{0} (false)\n'.format(strFunctions.cap(name)))
elif atttype == 'int' or atttype == 'uint':
output.write('\t, m{0} (SEDML_INT_MAX)\n'.format(strFunctions.cap(name)))
output.write('\t, mIsSet{0} (false)\n'.format(strFunctions.cap(name)))
elif atttype == 'bool':
output.write('\t, m{0} (false)\n'.format(strFunctions.cap(name)))
output.write('\t, mIsSet{0} (false)\n'.format(strFunctions.cap(name)))
elif atttype == 'std::vector<double>':
output.write('\t, m{0} ()\n'.format(strFunctions.capp(name)))
else:
output.write('\tFIX ME {0};\n'.format(name))
示例12: writeListOfSubFunctions
def writeListOfSubFunctions(attrib, output, element, elementDict):
loname = generalFunctions.writeListOf(strFunctions.cap(attrib['name']))
output.write(' /**\n')
output.write(' * Returns the \"{0}\"'.format(loname))
output.write(' in this {0} object.\n'.format(element))
output.write(' *\n')
output.write(' * @return the \"{0}\"'.format(loname))
output.write(' attribute of this {0}.\n'.format(element))
output.write(' */\n')
output.write(' const {0}*'.format(loname))
output.write(' getListOf{0}s() const;\n\n\n'.format(strFunctions.cap(attrib['name'])))
writeListOfHeader.writeGetFunctions(output, strFunctions.cap(attrib['name']), attrib['element'], True, element)
output.write(' /**\n')
output.write(' * Adds a copy the given \"{0}\" to this {1}.\n'.format(attrib['element'], element))
output.write(' *\n')
output.write(' * @param {0}; the {1} object to add\n'.format(strFunctions.objAbbrev(attrib['element']), attrib['element']))
output.write(' *\n')
output.write(' * @return integer value indicating success/failure of the\n')
output.write(' * function. @if clike The value is drawn from the\n')
output.write(' * enumeration #OperationReturnValues_t. @endif The possible values\n')
output.write(' * returned by this function are:\n')
output.write(' * @li LIBSEDML_OPERATION_SUCCESS\n')
output.write(' * @li LIBSEDML_INVALID_ATTRIBUTE_VALUE\n')
output.write(' */\n')
output.write(' int add{0}(const {1}* {2});\n\n\n'.format(strFunctions.cap(attrib['name']), attrib['element'], strFunctions.objAbbrev(attrib['element'])))
output.write(' /**\n')
output.write(' * Get the number of {0} objects in this {1}.\n'.format(attrib['element'], element))
output.write(' *\n')
output.write(' * @return the number of {0} objects in this {1}\n'.format(attrib['element'], element))
output.write(' */\n')
output.write(' unsigned int getNum{0}s() const;\n\n\n'.format(strFunctions.cap(attrib['name'])))
if attrib.has_key('abstract') == False or (attrib.has_key('abstract') and attrib['abstract'] == False):
output.write(' /**\n')
output.write(' * Creates a new {0} object, adds it to this {1}s\n'.format(attrib['element'], element))
output.write(' * {0} and returns the {1} object created.\n'.format(loname, attrib['element']))
output.write(' *\n')
output.write(' * @return a new {0} object instance\n'.format(attrib['element']))
output.write(' *\n')
output.write(' * @see add{0}(const {1}* {2})\n'.format(strFunctions.cap(attrib['name']), attrib['element'], strFunctions.objAbbrev(attrib['element'])))
output.write(' */\n')
output.write(' {0}* create{1}();\n\n\n'.format(attrib['element'], strFunctions.cap(attrib['name'])))
elif attrib.has_key('concrete'):
for elem in attrib['concrete']:
output.write(' /**\n')
output.write(' * Creates a new {0} object, adds it to this {1}s\n'.format(elem['element'], element))
output.write(' * {0} and returns the {1} object created.\n'.format(loname, elem['element']))
output.write(' *\n')
output.write(' * @return a new {0} object instance\n'.format(elem['element']))
output.write(' *\n')
output.write(' * @see add{0}(const {0}* {1})\n'.format(attrib['element'], strFunctions.objAbbrev(attrib['element'])))
output.write(' */\n')
output.write(' {0}* create{1}();\n\n\n'.format(elem['element'], strFunctions.cap(elem['name'])))
writeListOfHeader.writeRemoveFunctions(output, strFunctions.cap(attrib['name']), attrib['element'], True, element)
示例13: writeUnsetFunction
def writeUnsetFunction(attrib, output, element):
attName = attrib['name']
capAttName = strFunctions.cap(attName)
if attrib['type'] == 'lo_element' or attrib['type'] == 'inline_lo_element':
return
elif attrib['type'] == 'element':
output.write(' /**\n')
output.write(' * Unsets the \"{0}\"'.format(attName))
output.write(' element of this {0}.\n'.format(element))
output.write(' *\n')
output.write(' * @return integer value indicating success/failure of the\n')
output.write(' * function. @if clike The value is drawn from the\n')
output.write(' * enumeration #OperationReturnValues_t. @endif The possible values\n')
output.write(' * returned by this function are:\n')
output.write(' * @li LIBSBML_OPERATION_SUCCESS\n')
output.write(' * @li LIBSBML_OPERATION_FAILED\n')
output.write(' */\n')
output.write(' virtual int unset{0}();\n\n\n'.format(capAttName))
else:
output.write(' /**\n')
output.write(' * Unsets the value of the \"{0}\"'.format(attName))
output.write(' attribute of this {0}.\n'.format(element))
output.write(' *\n')
output.write(' * @return integer value indicating success/failure of the\n')
output.write(' * function. @if clike The value is drawn from the\n')
output.write(' * enumeration #OperationReturnValues_t. @endif The possible values\n')
output.write(' * returned by this function are:\n')
output.write(' * @li LIBSBML_OPERATION_SUCCESS\n')
output.write(' * @li LIBSBML_OPERATION_FAILED\n')
output.write(' */\n')
output.write(' virtual int unset{0}();\n\n\n'.format(capAttName))
示例14: writeSetDocCPPCode
def writeSetDocCPPCode(outFile, element,attribs, baseClass='SedBase'):
writeInternalStart(outFile)
outFile.write('/*\n')
outFile.write(' * Sets the parent SedDocument.\n')
outFile.write(' */\n')
outFile.write('void\n{0}::setSedDocument (SedDocument* d)\n'.format(element))
outFile.write('{\n')
outFile.write('\t{0}::setSedDocument(d);\n'.format(baseClass))
for i in range (0, len(attribs)):
if attribs[i]['type'] == 'lo_element' or ( attribs[i]['type'] == 'element' and attribs[i]['name'] != 'math'):
if attribs[i]['reqd'] == True or attribs[i]['type'] == 'lo_element':
outFile.write('\tm{0}.setSedDocument(d);\n'.format(strFunctions.capp(attribs[i]['name'], attribs[i]['type'] == 'lo_element')))
else:
outFile.write('\tif (m{0} != NULL)\n'.format(strFunctions.cap(attribs[i]['name'])))
outFile.write('\t\tm{0}->setSedDocument(d);\n'.format(strFunctions.cap(attribs[i]['name'])))
outFile.write('}\n\n\n')
writeInternalEnd(outFile)
示例15: writeExt
def writeExt(fileOut, name):
capName = name.upper()
fileOut.write('#ifdef USE_{0}\n'.format(capName))
fileOut.write('if (pkgName == "{0}")\n'.format(name))
fileOut.write('{\n')
fileOut.write(' return SWIGTYPE_p_{0}Extension;\n'.format(strFunctions.cap(name)))
fileOut.write('}\n')
fileOut.write('#endif // USE_{0} \n\n'.format(capName))