示例#1
0
def server_create_view(request):
    INIFileTemplate = _loadServerINITemplate()
    
    INIFileTemplate['server']["name"] =["name",""]
    
    INIFileDict = __fillINIwithTemplate(INIFileTemplate,{})    
    
    
    
    INIFileDict['server']["tests"] =[]
    INIFileDict['server']["outlets"] =[]
    INIFileDict['server']["controls"] =[]
    INIFileDict['server']["dependencies"] =[]
    
    multiListChoices = _makeMultichoice("server","tests",lambda: {},INIFileDict)
    multiListChoices = _makeMultichoice("server","outlets",lambda: {},INIFileDict,multiListChoices)
    multiListChoices = _makeMultichoice("server","controls",lambda: {},INIFileDict,multiListChoices)
    multiListChoices = _makeMultichoice("server","dependencies",lambda: {},INIFileDict,multiListChoices)
    return {"layout": site_layout(),
            "config_sidebar_head" : config_sidebar_head(),
            "config_sidebar_body" : config_sidebar_body(),

            "INI_InputArea_head" : INI_InputArea_head(),
            "INI_InputArea_body" : INI_InputArea_body(),            
            "INIFileDict" : INIFileDict,
            "INIFileTemplate" : INIFileTemplate,
            "multiListChoices" : multiListChoices,
            "OBJnameSection" : "server",
            
            "configPathPrefix": getServerFolder() + "/",
            "existingOBJCallback" : "checkExistingServers" ,
            
            "page_title": "Add new Server"
            }
示例#2
0
def server_edit_view(request):
    serverName = request.matchdict['serverName']
    
    configPath= _getServerConfigPath(serverName)
    INIFileDict = _loadServerConfig(serverName)
    
    #testerType = INIFileDict["tester"]["type"]
    INIFileTemplate = _loadServerINITemplate()
    
    INIFileDict = __fillINIwithTemplate(INIFileTemplate,INIFileDict)
    
    multiListChoices = _makeMultichoice("server","tests",lambda: getAvailableServerTesters(serverName),INIFileDict)
    multiListChoices = _makeMultichoice("server","outlets",lambda: getAvailableServerOutlets(serverName),INIFileDict,multiListChoices)
    multiListChoices = _makeMultichoice("server","controls",lambda: getAvailableServerControls(serverName),INIFileDict,multiListChoices)
    
    multiListChoices = _makeMultichoice("server","dependencies",lambda: getServerAvilableDependencies(serverName),INIFileDict,multiListChoices)
    
    #multiListChoices = _makeSelectMulitChoice(testerType,"tester",getAvailableTestersList)

    return {"layout": site_layout(),
            "config_sidebar_head" : config_sidebar_head(),
            "config_sidebar_body" : config_sidebar_body(),
            "INI_InputArea_head" : INI_InputArea_head(),
            "INI_InputArea_body" : INI_InputArea_body(),
            "INIFileDict" : INIFileDict,
            "INIFileTemplate" : INIFileTemplate,
            "configPath" : configPath,
            "serverName" : serverName,
            "multiListChoices" : multiListChoices,
            "deleteCallback" : "server",
            "objectName" : str(serverName),
            "redirectURL" : "/",
            
            "page_title": "Server Edit: " + str(serverName)}