ccpnmodel.ccpncore.memops.scripts.xmlio package

Submodules

ccpnmodel.ccpncore.memops.scripts.xmlio.CompatibilityGen module

Module Documentation here

class ccpnmodel.ccpncore.memops.scripts.xmlio.CompatibilityGen.LocalXmlGen(**kw)[source]

Bases: ccpnmodel.ccpncore.memops.format.xml.XmlGen.XmlGen

ccpnmodel.ccpncore.memops.scripts.xmlio.CompatibilityGen.dirNameFromVersionString(versionString)[source]

generate directory name from version string

ccpnmodel.ccpncore.memops.scripts.xmlio.CompatibilityGen.makeCompatibility(fromModel, toModel, modelPortal=None, elementPairings=None, fileName='CompatibilityMapInfo.py')[source]

Make compatibility info for converting fromModel to toModel. elementPairings is a list of (oldGuid, newGuid) pairs that map elements from the two models. Note that several old guids can map to a single new guid and vice versa.

ccpnmodel.ccpncore.memops.scripts.xmlio.CompatibilityGen.makeUpgrade(fromVersionTag, toVersionTag, toTopPackage=None, modelPortal=None, includePackageNames=(), excludePackageNames=(), infoFileName=None)[source]

Make upgrade or downgrade map code from fromVersion to toVersion Will look for the models in ccpnmodel.versionDir and place the compatibility code in e.g. ccpncore/memops/format/compatibility/upgrade/v_2_0_3/MapInfo.py ccpncore/memops/format/compatibility/downgrade/v_2_2_1/MapInfo.py

ccpnmodel.ccpncore.memops.scripts.xmlio.CompatibilityGen.versionFromDir(topDir)[source]

Get current version string for directory tree rooted in topDir

ccpnmodel.ccpncore.memops.scripts.xmlio.PyXmlMapWrite module

Module Documentation here

class ccpnmodel.ccpncore.memops.scripts.xmlio.PyXmlMapWrite.PyXmlMapWrite(**kw)[source]

Bases: ccpnmodel.ccpncore.memops.scripts.core.PyLanguage.PyLanguage, ccpnmodel.ccpncore.memops.scripts.core.PyType.PyType, ccpnmodel.ccpncore.memops.scripts.xmlio.XmlMapWrite.XmlMapWrite

addDefaultValues(dictName, elemMap, elem)[source]

write default values. NB individual languages may choose to skip some of the more difficult ones. The value is compared with the stored value in XmlIo, look there for exact format.

addXmlClassCreation(dictName, clazz, package=None)[source]

Write info for creation of new class

addXmlStringFunctions(dictName, typeCode)[source]

Write info for conversion to and from string Must be overridden in subclasses

endLeafPackage(package)[source]

processing actions for end of LeafPackage

initLeafPackage(package)[source]

write API header for package containing actual code

raiseApiError(errorMsg, obj=None, obj2=None, obj3=None)[source]

NB obj and obj2 and obj3 must evaluate to a single Python object More specifically you can pass in a tuple, like ‘(a,b,c)’ but not a comma-separated list, like ‘a,b,c’

streamAddAll(collectionToBeAdded, collectionToBeAddedTo)[source]
streamCallConstructor(var, constructor, parent=None, castType=None, **attrlinks)[source]
streamConvertStringToValue(cnvrt, value)[source]
streamDoCompatibility()[source]
streamElementAttr(key)[source]
streamElementIsSkip(doReset=True)[source]
streamElementSetSkip(setToNone=False)[source]
streamElementSplitText(var, cnvrt=None)[source]
streamElementTag(state='start')[source]
streamElementText()[source]
streamEndElement()[source]
streamEndParse()[source]
streamFoundClosingTag()[source]
streamGetValue(var, name, defaultValue=None, keyIsMandatory=False, getChildAsDict=False)[source]
streamHaveEarlyExit()[source]
streamIndent(increasing)[source]
streamInitLoadingMaps()[source]
streamNextElement()[source]
streamNonTextToString(value)[source]
streamObjDictKey(obj, isMetaClass)[source]
streamOrderedCollection(var)[source]
streamOverrideOff(var)[source]
streamSetValue(var, name, value, useDirectSet=True)[source]
streamStartAttributeLoop(tag, value)[source]
streamStartElement()[source]
streamStartFunc(funcname, params=None, docString='', returnString='', returnType=None, throwsApiError=True)[source]
streamStartParse()[source]
streamWrite(s)[source]
streamWriteAttr(key, value)[source]
streamWriteComment(comment)[source]
streamWriteEndElement(element, newLine=True, doIndent=False)[source]
streamWriteStartElement(element, closeElement=True, newLine=True, **attrs)[source]
streamWriteValue(value)[source]
writeFileHeader(package)[source]
writeLoadFromStreamEnd()[source]
writeLoadFromStreamHandleError()[source]
writeLoadFromStreamMain()[source]
writeLoadFromStreamStart()[source]
writeSaveToStreamBody(originator, indentBySpaces=2)[source]
ccpnmodel.ccpncore.memops.scripts.xmlio.PyXmlMapWrite.writeXmlIo(modelPortal, rootFileName=None, rootDirName=None, releaseVersion=None, **kw)[source]

write Python XML I/O mappings and code

Only function that should be called directly by ‘make’ scripts etc.

ccpnmodel.ccpncore.memops.scripts.xmlio.XmlMapWrite module

Module Documentation here

class ccpnmodel.ccpncore.memops.scripts.xmlio.XmlMapWrite.XmlMapWrite(**kw)[source]

Bases: ccpnmodel.ccpncore.memops.scripts.core.LanguageInterface.LanguageInterface, ccpnmodel.ccpncore.memops.scripts.core.TypeInterface.TypeInterface, ccpnmodel.ccpncore.memops.metamodel.TextWriter.TextWriter, ccpnmodel.ccpncore.memops.format.xml.XmlGen.XmlGen

addDefaultValues(dictName, elemMap, elem)[source]

write default values. NB individual languages may choose to skip some of the more difficult ones. The value is compared with the stored value in XmlIo, look there for exact format.

addXmlClassCreation(dictName, clazz, package=None)[source]

Write info for creation of new class

addXmlStringFunctions(dictName, typeCode)[source]

Write info for conversion to and from string Must be overridden in subclasses

codeDirName = 'xml'
endComplexDataType(clazz)[source]
endLeafPackage(package)[source]

processing actions for end of LeafPackage

getSaveToStreamDocString()[source]
initLeafPackage(package)[source]

write API header for package containing actual code

localVarNames = {'aDict': 'aDict', 'aList': 'aList', 'abstractTypes': 'abstractTypes', 'contentMap': 'contentMap', 'currentMap': 'currentMap', 'exolinks': 'exolinks', 'globalMap': 'globalMap', 'loadMaps': 'loadMaps', 'mapsByGuid': 'mapsByGuid'}
processAbstractDataType(clazz)[source]
processAttribute(elem, inClass)[source]

processing actions for attribute

processBranchPackage(package)[source]

processing actions for branch package

processClass(clazz)[source]

processing actions for body of class

processDataObjType(clazz)[source]

processing actions for body of class

processDataType(clazz)[source]

toStr, cnvrt, and baseType postponed, being language dependent

processElement(elemMap)[source]
processLeafPackage(package)[source]

make data dictionaries for package containing actual code

processRole(elem, inClass)[source]

processing actions for role

setupLeafPackage(package)[source]
streamAddAll(collectionToBeAdded, collectionToBeAddedTo)[source]
streamCallConstructor(var, constructor, parent=None, castType=None, **attrlinks)[source]
streamConvertStringToValue(cnvrt, value)[source]
streamDoCompatibility()[source]
streamElementAttr(key)[source]
streamElementCheckSkip(doReset=True)[source]
streamElementIsSkip(doReset=True)[source]
streamElementSetSkip(setToNone=False)[source]
streamElementSplitText(var, cnvrt=None)[source]
streamElementTag(state='start')[source]
streamElementText()[source]
streamEndElement()[source]
streamEndParse()[source]
streamFoundClosingTag()[source]
streamGetValue(var, name, defaultValue=None, keyIsMandatory=False, getChildAsDict=False)[source]
streamHaveEarlyExit()[source]
streamIndent(increasing)[source]
streamInitLoadingMaps()[source]
streamNextElement()[source]
streamNonTextToString(value)[source]
streamObjDictKey(obj, isMetaClass)[source]
streamOrderedCollection(var)[source]
streamOverrideOff(var)[source]
streamSetValue(var, name, value, useDirectSet=True)[source]
streamStartAttributeLoop(tag, value)[source]
streamStartElement()[source]
streamStartFunc(funcname, params=None, docString='', returnString='', returnType=None, throwsApiError=True)[source]
streamStartParse()[source]
streamTextToString(value)[source]
streamWrite(s)[source]
streamWriteAttr(key, value)[source]
streamWriteComment(comment)[source]
streamWriteElement(element, value='', **attrs)[source]
streamWriteEndElement(element, newLine=True, doIndent=False)[source]
streamWriteStartElement(element, closeElement=True, newLine=True, **attrs)[source]
streamWriteValue(value)[source]
writeDelayedLoadLinksBody(tag)[source]
writeGetLoadingMaps()[source]
writeGetLoadingMapsBody()[source]
writeLinkChildData()[source]
writeLinkChildDataBody()[source]
writeLoadFromStream(parser)[source]
writeLoadFromStreamBody()[source]
writeLoadFromStreamEnd()[source]
writeLoadFromStreamErrorBody()[source]
writeLoadFromStreamExtraFunctions()[source]
writeLoadFromStreamHandleError()[source]
writeLoadFromStreamMain()[source]
writeLoadFromStreamStart()[source]
writeSaveToStream(originator, indentBySpaces=2)[source]
writeSaveToStreamBody(originator, indentBySpaces=2)[source]