Пример #1
0
def buildCommandFunction_commandlineArgsOnly(task):
    
    parameterBindings = task.parameterBindings()
    
    commandlineParameterFilter = \
        task.definition().getFilterForCommandlineArguments()

    commandLineParameters = [
        x for x in
        task.definition().getParametersByFilter(commandlineParameterFilter)]

    commandLineParameters = ParameterModule.sortParameters(
        commandLineParameters, 
        task.definition().parameterOrderingTable())
    
    command = []
    for parameter in commandLineParameters:

        command.extend(buildParameterArgument(parameter, parameterBindings))
        
        pass
            
    return command
Пример #2
0
    def getArguments(self, task):

        parameterBindings = task.parameterBindings()

        parameterFilter = task.definition().getFilterForCommandlineArguments()
    
        parameters = [
            x for x in
            task.definition().getParametersByFilter(parameterFilter)]

        parameters = ParameterModule.sortParameters(
            parameters, 
            task.definition().parameterOrderingTable())

        commandArgList = []
        for parameter in parameters:
            key = parameter.id()

            value = task.getParameterBinding(key)
            if isinstance(value, str):
                # TODO
                # this should attempt to escape certain chars?
                value = '"%s"' % value
            else:
                value = str(value)

            # need to determine if should pass as keyword
            # and if so, need to retrieve the keyword
            if parameter.getAttribute(ParameterModule.PORT_ATTRIBUTE_KEYWORD):
                keyword = parameter.getAttribute(ParameterModule.PORT_ATTRIBUTE_KEYWORDTOPASS)
                value = '='.join([keyword, value])

            commandArgList.append(value)
            pass

        return commandArgList