Changeset 83364 in vbox for trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpform.py
- Timestamp:
- Mar 23, 2020 9:47:01 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/webui/wuihlpform.py
r82968 r83364 40 40 from testmanager.core.testcaseargs import TestCaseArgsData; 41 41 from testmanager.core.testgroup import TestGroupMemberData, TestGroupDataEx; 42 from testmanager.core.testbox import TestBoxDataForSchedGroup; 42 43 43 44 # Python 3 hacks: … … 654 655 self._addLabel(sName, sLabel); 655 656 if not aoAllTestCases: 656 return self._add('<li>No testcases available.</li>\n')657 return self._add('<li>No testcases.</li>\n') 657 658 658 659 self._add(u'<input name="%s" type="hidden" value="%s">\n' … … 763 764 u'</table>\n'); 764 765 765 def addListOfSchedGroupMembers(self, sName, aoSchedGroupMembers, aoAll TestGroups, # pylint: disable=too-many-locals766 def addListOfSchedGroupMembers(self, sName, aoSchedGroupMembers, aoAllRelevantTestGroups, # pylint: disable=too-many-locals 766 767 sLabel, fReadOnly = True): 767 768 """ … … 770 771 if fReadOnly is None or self._fReadOnly: 771 772 fReadOnly = self._fReadOnly; 772 assert len(aoSchedGroupMembers) <= len(aoAll TestGroups);773 assert len(aoSchedGroupMembers) <= len(aoAllRelevantTestGroups); 773 774 self._addLabel(sName, sLabel); 774 if not aoAll TestGroups:775 return self._add(u'<li>No test groups available.</li>\n')775 if not aoAllRelevantTestGroups: 776 return self._add(u'<li>No test groups.</li>\n') 776 777 777 778 self._add(u'<input name="%s" type="hidden" value="%s">\n' 778 779 % ( SchedGroupDataEx.ksParam_aidTestGroups, 779 ','.join([unicode(oTestGroup.idTestGroup) for oTestGroup in aoAll TestGroups]), ));780 ','.join([unicode(oTestGroup.idTestGroup) for oTestGroup in aoAllRelevantTestGroups]), )); 780 781 781 782 self._add(u'<table class="tmformtbl">\n' … … 797 798 oDefMember = SchedGroupMemberData(); 798 799 aoSchedGroupMembers = list(aoSchedGroupMembers); # Copy it so we can pop. 799 for iTestGroup, _ in enumerate(aoAll TestGroups):800 oTestGroup = aoAll TestGroups[iTestGroup];800 for iTestGroup, _ in enumerate(aoAllRelevantTestGroups): 801 oTestGroup = aoAllRelevantTestGroups[iTestGroup]; 801 802 802 803 # Is it a member? … … 844 845 ' selected' if oMember is None or oMember.idTestGroupPreReq is None else '', 845 846 )); 846 for oTestGroup2 in aoAll TestGroups:847 for oTestGroup2 in aoAllRelevantTestGroups: 847 848 if oTestGroup2 != oTestGroup: 848 849 fSelected = oMember is not None and oTestGroup2.idTestGroup == oMember.idTestGroupPreReq; … … 862 863 u'</table>\n'); 863 864 865 def addListOfSchedGroupBoxes(self, sName, aoSchedGroupBoxes, aoAllRelevantTestBoxes, # pylint: disable=too-many-locals 866 sLabel, fReadOnly = True): # (str, list[TestBoxDataEx], list[TestBoxDataEx], str, bool) -> str 867 """ 868 For WuiAdminSchedGroup. 869 """ 870 if fReadOnly is None or self._fReadOnly: 871 fReadOnly = self._fReadOnly; 872 assert len(aoSchedGroupBoxes) <= len(aoAllRelevantTestBoxes); 873 self._addLabel(sName, sLabel); 874 if not aoAllRelevantTestBoxes: 875 return self._add(u'<li>No test boxes.</li>\n') 876 877 self._add(u'<input name="%s" type="hidden" value="%s">\n' 878 % ( SchedGroupDataEx.ksParam_aidTestBoxes, 879 ','.join([unicode(oTestBox.idTestBox) for oTestBox in aoAllRelevantTestBoxes]), )); 880 881 ## @todo replace with tmform-field-list tricks. 882 self._add(u'<table class="tmformtbl">\n' 883 u' <thead>\n' 884 u' <tr>\n' 885 u' <th></th>\n' 886 u' <th>Test Box</th>\n' 887 u' <th>Priority [0..31]</th>\n' 888 u' </tr>\n' 889 u' </thead>\n' 890 u' <tbody>\n' 891 ); 892 893 sCheckBoxAttr = u' readonly onclick="return false" onkeydown="return false"' if fReadOnly else ''; 894 895 oDefMember = TestBoxDataForSchedGroup(); 896 aoSchedGroupBoxes = list(aoSchedGroupBoxes); # Copy it so we can pop. 897 for iTestBox, _ in enumerate(aoAllRelevantTestBoxes): 898 oTestBox = aoAllRelevantTestBoxes[iTestBox]; 899 900 # Is it a member? 901 oMember = None; 902 for i, _ in enumerate(aoSchedGroupBoxes): 903 if aoSchedGroupBoxes[i].oTestBox and aoSchedGroupBoxes[i].oTestBox.idTestBox == oTestBox.idTestBox: 904 oMember = aoSchedGroupBoxes.pop(i); 905 break; 906 907 # Start on the rows... 908 sPrefix = u'%s[%d]' % (sName, oTestBox.idTestBox,); 909 self._add(u' <tr class="%s">\n' 910 u' <td>\n' 911 u' <input name="%s[%s]" type="hidden" value="%s">\n' # idTestBox 912 u' <input name="%s[%s]" type="hidden" value="%s">\n' # idSchedGroup 913 u' <input name="%s[%s]" type="hidden" value="%s">\n' # tsExpire 914 u' <input name="%s[%s]" type="hidden" value="%s">\n' # tsEffective 915 u' <input name="%s[%s]" type="hidden" value="%s">\n' # uidAuthor 916 u' <input name="%s" type="checkbox"%s%s value="%d" class="tmform-checkbox" title="#%d - %s">\n' #(list) 917 u' </td>\n' 918 % ( 'tmodd' if iTestBox & 1 else 'tmeven', 919 sPrefix, TestBoxDataForSchedGroup.ksParam_idTestBox, oTestBox.idTestBox, 920 sPrefix, TestBoxDataForSchedGroup.ksParam_idSchedGroup, -1 if oMember is None else oMember.idSchedGroup, 921 sPrefix, TestBoxDataForSchedGroup.ksParam_tsExpire, '' if oMember is None else oMember.tsExpire, 922 sPrefix, TestBoxDataForSchedGroup.ksParam_tsEffective, '' if oMember is None else oMember.tsEffective, 923 sPrefix, TestBoxDataForSchedGroup.ksParam_uidAuthor, '' if oMember is None else oMember.uidAuthor, 924 SchedGroupDataEx.ksParam_aoTestBoxes, '' if oMember is None else ' checked', sCheckBoxAttr, 925 oTestBox.idTestBox, oTestBox.idTestBox, escapeElem(oTestBox.sName), 926 )); 927 self._add(u' <td align="left">%s</td>\n' % ( escapeElem(oTestBox.sName), )); 928 929 self._add(u' <td align="center">\n' 930 u' <input name="%s[%s]" type="text" value="%s" style="max-width:3em;" %s>\n' 931 u' </td>\n' 932 % ( sPrefix, 933 TestBoxDataForSchedGroup.ksParam_iSchedPriority, 934 (oMember if oMember is not None else oDefMember).iSchedPriority, 935 ' readonly class="tmform-input-readonly"' if fReadOnly else '', )); 936 937 self._add(u' </tr>\n'); 938 return self._add(u' </tbody>\n' 939 u'</table>\n'); 940 864 941 def addListOfSchedGroupsForTestBox(self, sName, aoInSchedGroups, aoAllSchedGroups, sLabel, # pylint: disable=too-many-locals 865 942 fReadOnly = None): … … 880 957 self._addLabel(sName, sLabel); 881 958 if not aoAllSchedGroups: 882 return self._add('<li>No scheduling groups available.</li>\n')959 return self._add('<li>No scheduling groups.</li>\n') 883 960 884 961 # Add special parameter with all the scheduling group IDs in the form.
Note:
See TracChangeset
for help on using the changeset viewer.