VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/testmanager/webui/wuitestresultfailure.py@ 61220

最後變更 在這個檔案從61220是 61217,由 vboxsync 提交於 9 年 前

testmanager: give reason to failures (quick hack, can do prettier later).

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.9 KB
 
1# -*- coding: utf-8 -*-
2# $Id: wuitestresultfailure.py 61217 2016-05-26 20:04:05Z vboxsync $
3
4"""
5Test Manager WUI - Dummy Test Result Failure Reason Edit Dialog - just for error handling!
6"""
7
8__copyright__ = \
9"""
10Copyright (C) 2012-2016 Oracle Corporation
11
12This file is part of VirtualBox Open Source Edition (OSE), as
13available from http://www.alldomusa.eu.org. This file is free software;
14you can redistribute it and/or modify it under the terms of the GNU
15General Public License (GPL) as published by the Free Software
16Foundation, in version 2 as it comes in the "COPYING" file of the
17VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19
20The contents of this file may alternatively be used under the terms
21of the Common Development and Distribution License Version 1.0
22(CDDL) only, as it comes in the "COPYING.CDDL" file of the
23VirtualBox OSE distribution, in which case the provisions of the
24CDDL are applicable instead of those of the GPL.
25
26You may elect to license modified versions of this file under the
27terms and conditions of either the GPL or the CDDL or both.
28"""
29__version__ = "$Revision: 61217 $"
30
31# Validation Kit imports.
32from testmanager.webui.wuicontentbase import WuiFormContentBase;
33from testmanager.core.testresults import TestResultFailureData;
34from testmanager.core.failurereason import FailureReasonLogic;
35
36
37class WuiTestResultFailure(WuiFormContentBase):
38 """
39 WUI test result failure error form generator.
40 """
41 def __init__(self, oData, sMode, oDisp):
42 if sMode == WuiFormContentBase.ksMode_Add:
43 sTitle = 'Add Test Result Failure Reason';
44 elif sMode == WuiFormContentBase.ksMode_Edit:
45 sTitle = 'Modify Test Result Failure Reason';
46 else:
47 assert sMode == WuiFormContentBase.ksMode_Show;
48 sTitle = 'Test Result Failure Reason';
49 ## submit access.
50 WuiFormContentBase.__init__(self, oData, sMode, 'TestResultFailure', oDisp, sTitle);
51
52 def _populateForm(self, oForm, oData):
53
54 aoFailureReasons = FailureReasonLogic(self._oDisp.getDb()).fetchForCombo('Todo: Figure out why');
55 oForm.addComboBox(TestResultFailureData.ksParam_idFailureReason, oData.idFailureReason,
56 'Reason', aoFailureReasons)
57 oForm.addMultilineText(TestResultFailureData.ksParam_sComment, oData.sComment, 'Comment');
58 oForm.addIntRO( TestResultFailureData.ksParam_idTestResult, oData.idTestResult, 'Test Result ID');
59 oForm.addTimestampRO(TestResultFailureData.ksParam_tsEffective, oData.tsEffective, 'Effective Date');
60 oForm.addTimestampRO(TestResultFailureData.ksParam_tsExpire, oData.tsExpire, 'Expire (excl)');
61 oForm.addIntRO( TestResultFailureData.ksParam_uidAuthor, oData.uidAuthor, 'Changed by UID');
62 if self._sMode != WuiFormContentBase.ksMode_Show:
63 oForm.addSubmit('Add' if self._sMode == WuiFormContentBase.ksMode_Add else 'Modify');
64 return True;
65
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette