示例#1
0
def createDiagram(context, detailLevel=0, mode='dot'):
    """Creates an UML diagram based on the classes of the server.
	
	Keyword arguments:
	detailLevel -- Detail level of the diagram. If it is not present, 0 will be assumed
        mode -- one of graph layout modes to be passed to graphviz
	"""
    graphvizArgs = {
        'dot': [],
        'circo': [
            '-Kcirco', '-Gsplines=true', '-Granksep=0.1', '-Gmindist=0',
            '-Goverlap=false', '-Gepsilon=0.00001'
        ],
        'fdp': [
            '-Kfdp', '-Gsplines=true', '-Goverlap=false', '-Gepsilon=0.00001',
            '-GK=0.01', '-Gmaxiter=10000', '-Gstart=random'
        ]
    }
    print 'Using {0} as level of detail'.format(str(detailLevel))
    print 'Using {0} as layout mode. Hint: from quasar 1.3.5, you can choose among: {1}, run with -h for help.'.format(
        mode, ','.join(graphvizArgs.keys()))
    transformByKey(TransformKeys.CREATE_DIAGRAM_DOT, {
        'context': context,
        'detailLevel': detailLevel
    })
    args = [
        "-Tpdf", "-o", designPath + "diagram.pdf",
        getTransformOutput(TransformKeys.CREATE_DIAGRAM_DOT,
                           {'context': context})
    ] + graphvizArgs[mode]
    subprocessWithImprovedErrors([getCommand("graphviz")] + args,
                                 "GraphViz (dot)")
示例#2
0
def upgradeDesign(context, additionalParam):
    """Method for adjusting Design.xml for a new Design.xsd when updating to a new version of the Framework"""
    print("Formatting your design file ...")
    formatDesign()

    transformByKey(TransformKeys.UPGRADE_DESIGN, {'context':context, 'whatToDo':additionalParam})

    print("Formatting the upgraded file ")
    upgradedNonFormatted = getTransformOutput(TransformKeys.UPGRADE_DESIGN, {'context':context} )
    upgradedFormatted = upgradedNonFormatted + ".formatted"

    formatXml(upgradedNonFormatted, upgradedFormatted)

    print("Now running merge-tool. Please merge the upgraded changed")
    subprocessWithImprovedErrors([getCommand("diff"), "-o", designPath + designXML, designPath + designXML, upgradedFormatted], getCommand("diff"))
示例#3
0
def generateConfiguration(context):
	"""Generates the file Configuration.xsd. This method is called automatically by cmake, it does not need to be called by the user."""
	config_xsd_path = os.path.join(context['projectBinaryDir'],'Configuration','Configuration.xsd')
	try: 
		transformByKey( TransformKeys.CONFIGURATION_XSD, {
			'context':context,
			'metaXsdPath':os.path.join(context['projectSourceDir'],'Meta','config','Meta.xsd').replace('\\','/') } )
	except:	
		if os.path.isfile(config_xsd_path):
			os.remove(config_xsd_path)
		raise
	subprocessWithImprovedErrorsPipeOutputToFile(
		[getCommand("xmllint"), "--xinclude", getTransformOutput(TransformKeys.CONFIGURATION_XSD, {'context':context})], 
		config_xsd_path, 
		getCommand("xmllint"))
示例#4
0
def createDiagram(context, detailLevel=0):
    """Creates an UML diagram based on the classes of the server.
	
	Keyword arguments:
	detailLevel -- Detail level of the diagram. If it is not present, 0 will be assumed
	"""
    if detailLevel == "":
        detailLevel = 0
    transformByKey(TransformKeys.CREATE_DIAGRAM_DOT, {
        'context': context,
        'detailLevel': detailLevel
    })
    print("Generating pdf diagram with dot.")
    subprocessWithImprovedErrors([
        getCommand("graphviz"), "-Tpdf", "-o", designPath + "diagram.pdf",
        getTransformOutput(TransformKeys.CREATE_DIAGRAM_DOT,
                           {'context': context})
    ], "GraphViz (dot)")