wuiadminbuildblacklist.py revision cf22150eaeeb72431bf1cf65c309a431454fb22b
4b3769ce483ece06f60f983193712492b920144fJake Feasel# -*- coding: utf-8 -*-
b4260bb3e2303240ecf6c7e4e5639439c3f98889Brendan MmillerTest Manager WUI - Build Blacklist.
4b3769ce483ece06f60f983193712492b920144fJake FeaselCopyright (C) 2012-2014 Oracle Corporation
4b3769ce483ece06f60f983193712492b920144fJake FeaselThis file is part of VirtualBox Open Source Edition (OSE), as
4b3769ce483ece06f60f983193712492b920144fJake Feaselavailable from http://www.virtualbox.org. This file is free software;
4b3769ce483ece06f60f983193712492b920144fJake Feaselyou can redistribute it and/or modify it under the terms of the GNU
4b3769ce483ece06f60f983193712492b920144fJake FeaselGeneral Public License (GPL) as published by the Free Software
4b3769ce483ece06f60f983193712492b920144fJake FeaselFoundation, in version 2 as it comes in the "COPYING" file of the
4b3769ce483ece06f60f983193712492b920144fJake FeaselVirtualBox OSE distribution. VirtualBox OSE is distributed in the
4b3769ce483ece06f60f983193712492b920144fJake Feaselhope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4b3769ce483ece06f60f983193712492b920144fJake FeaselThe contents of this file may alternatively be used under the terms
4b3769ce483ece06f60f983193712492b920144fJake Feaselof the Common Development and Distribution License Version 1.0
4b3769ce483ece06f60f983193712492b920144fJake Feasel(CDDL) only, as it comes in the "COPYING.CDDL" file of the
4b3769ce483ece06f60f983193712492b920144fJake FeaselVirtualBox OSE distribution, in which case the provisions of the
4b3769ce483ece06f60f983193712492b920144fJake FeaselCDDL are applicable instead of those of the GPL.
4b3769ce483ece06f60f983193712492b920144fJake FeaselYou may elect to license modified versions of this file under the
b4260bb3e2303240ecf6c7e4e5639439c3f98889Brendan Mmillerterms and conditions of either the GPL or the CDDL or both.
4b3769ce483ece06f60f983193712492b920144fJake Feasel# Validation Kit imports.
4b3769ce483ece06f60f983193712492b920144fJake Feaselfrom testmanager.webui.wuibase import WuiException
4b3769ce483ece06f60f983193712492b920144fJake Feaselfrom testmanager.webui.wuicontentbase import WuiFormContentBase, WuiListContentBase, WuiTmLink
4b3769ce483ece06f60f983193712492b920144fJake Feaselfrom testmanager.core.buildblacklist import BuildBlacklistData
4b3769ce483ece06f60f983193712492b920144fJake Feaselfrom testmanager.core.failurereason import FailureReasonLogic
4b3769ce483ece06f60f983193712492b920144fJake Feaselfrom testmanager.core.db import TMDatabaseConnection
b4260bb3e2303240ecf6c7e4e5639439c3f98889Brendan Mmillerclass WuiAdminBuildBlacklist(WuiFormContentBase):
0b90cf39da4c7ba2b843ffd3512d84d009b5dff0Brendan Mmiller WUI Build Black List Form.
0b90cf39da4c7ba2b843ffd3512d84d009b5dff0Brendan Mmiller Prepare & initialize parent
b4260bb3e2303240ecf6c7e4e5639439c3f98889Brendan Mmiller elif sMode == WuiFormContentBase.ksMode_Edit:
b4260bb3e2303240ecf6c7e4e5639439c3f98889Brendan Mmiller assert sMode == WuiFormContentBase.ksMode_Show;
b4260bb3e2303240ecf6c7e4e5639439c3f98889Brendan Mmiller WuiFormContentBase.__init__(self, oData, sMode, 'BuildBlacklist', oDisp, sTitle);
4b3769ce483ece06f60f983193712492b920144fJake Feasel # Additional data.
0c3f79f75f596c8d6700b2de830000f754bb28a9Phill Cunnington Construct an HTML form
4b3769ce483ece06f60f983193712492b920144fJake Feasel aoFailureReasons = FailureReasonLogic(self._oDisp.getDb()).fetchForCombo()
4b3769ce483ece06f60f983193712492b920144fJake Feasel raise WuiException('Please <a href="%s?%s=%s">add</a> some Failure Reasons first.'
4b3769ce483ece06f60f983193712492b920144fJake Feasel % (WuiAdmin.ksScriptName, WuiAdmin.ksParamAction, WuiAdmin.ksActionFailureReasonShowAdd));
4b3769ce483ece06f60f983193712492b920144fJake Feasel asTypes = self.getListOfItems(self.asTypes, oData.asTypes)
4b3769ce483ece06f60f983193712492b920144fJake Feasel asOsArches = self.getListOfItems(self.asOsArches, oData.asOsArches)
4b3769ce483ece06f60f983193712492b920144fJake Feasel oForm.addIntRO (BuildBlacklistData.ksParam_idBlacklisting, oData.idBlacklisting, 'Blacklist item ID')
b4260bb3e2303240ecf6c7e4e5639439c3f98889Brendan Mmiller oForm.addTimestampRO(BuildBlacklistData.ksParam_tsEffective, oData.tsEffective, 'Last changed')
oForm.addComboBox (BuildBlacklistData.ksParam_idFailureReason, oData.idFailureReason, 'Failure Reason',
oForm.addInt (BuildBlacklistData.ksParam_iLastRevision, oData.iLastRevision, 'Last revision (incl)')
return True;
sShortFailReason = \