- Timestamp:
- Jun 5, 2016 5:46:15 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 107799
- Location:
- trunk/src/VBox/ValidationKit/testmanager
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/globalresource.py
r61220 r61472 73 73 def initFromDbRow(self, aoRow): 74 74 """ 75 Reinitialize from a SELECT * FROM TestCases row.75 Reinitialize from a SELECT * FROM GlobalResources row. 76 76 Returns self. Raises exception if no row. 77 77 """ -
trunk/src/VBox/ValidationKit/testmanager/core/schedgroup.py
r61468 r61472 65 65 kiMax_iSchedPriority = 32; 66 66 67 kcDbColumns = 8 67 68 68 69 def __init__(self): … … 125 126 """ 126 127 SchedGroupMemberData.initFromDbRow(self, aoRow); 127 self.oTestGroup = TestGroupData().initFromDbRow(aoRow[ 8:]);128 self.oTestGroup = TestGroupData().initFromDbRow(aoRow[SchedGroupMemberData.kcDbColumns:]); 128 129 return self; 129 130 … … 170 171 ksParam_idBuildSrc = 'SchedGroup_idBuildSrc'; 171 172 ksParam_idBuildSrcTestSuite = 'SchedGroup_idBuildSrcTestSuite'; 173 ksParam_sComment = 'SchedGroup_sComment'; 172 174 173 175 kasAllowNullAttributes = ['idSchedGroup', 'tsEffective', 'tsExpire', 'uidAuthor', 'sDescription', 174 'idBuildSrc', 'idBuildSrcTestSuite' ];176 'idBuildSrc', 'idBuildSrcTestSuite', 'sComment' ]; 175 177 kasValidValues_enmScheduler = [ksScheduler_BestEffortContinousItegration, ]; 178 179 kcDbColumns = 11; 176 180 177 181 # Scheduler types … … 197 201 self.enmScheduler = SchedGroupData.ksScheduler_BestEffortContinousItegration; 198 202 self.idBuildSrc = None; 199 self.idBuildSrcTestSuite = None; 203 self.idBuildSrcTestSuite = None; 204 self.sComment = None; 200 205 201 206 def initFromDbRow(self, aoRow): … … 218 223 self.enmScheduler = aoRow[7]; 219 224 self.idBuildSrc = aoRow[8]; 220 self.idBuildSrcTestSuite = aoRow[9]; 225 self.idBuildSrcTestSuite = aoRow[9]; 226 self.sComment = aoRow[10]; 221 227 return self; 222 228 … … 496 502 ' enmScheduler,\n' 497 503 ' idBuildSrc,\n' 498 ' idBuildSrcTestSuite)\n' 499 'VALUES (%s, %s, %s, %s, %s, %s, %s)\n' 504 ' idBuildSrcTestSuite,\n' 505 ' sComment)\n' 506 'VALUES (%s, %s, %s, %s, %s, %s, %s, %s)\n' 500 507 'RETURNING idSchedGroup\n' 501 , (uidAuthor, 502 oData.sName, 503 oData.sDescription, 504 oData.fEnabled, 505 oData.enmScheduler, 506 oData.idBuildSrc, 507 oData.idBuildSrcTestSuite)); 508 , ( uidAuthor, 509 oData.sName, 510 oData.sDescription, 511 oData.fEnabled, 512 oData.enmScheduler, 513 oData.idBuildSrc, 514 oData.idBuildSrcTestSuite, 515 oData.sComment )); 508 516 idSchedGroup = self._oDb.fetchOne()[0]; 509 517 oData.idSchedGroup = idSchedGroup; … … 803 811 def exists(self, sName): 804 812 """Checks if a group with the given name exists.""" 805 self._oDb.execute('SELECT *\n'813 self._oDb.execute('SELECT idSchedGroup\n' 806 814 'FROM SchedGroups\n' 807 815 'WHERE tsExpire = \'infinity\'::TIMESTAMP\n' 808 ' AND sName = %s\n' 816 ' AND sName = %s\n' 817 'LIMIT 1\n' 809 818 , (sName,)); 810 819 return self._oDb.getRowCount() > 0; … … 814 823 self._oDb.execute('SELECT *\n' 815 824 'FROM SchedGroups\n' 816 'WHERE tsExpire = \'infinity\'::timestamp\n'825 'WHERE tsExpire = \'infinity\'::timestamp\n' 817 826 ' AND idSchedGroup = %s;', (idSchedGroup,)) 818 827 aRows = self._oDb.fetchAll() … … 825 834 return None 826 835 827 def remove(self, uidAuthor, idScedGroup, fNeedCommit=True):828 """Historize Scheduling Group record"""829 self._oDb.execute('UPDATE SchedGroups\n'830 'SET tsExpire = CURRENT_TIMESTAMP,\n'831 ' uidAuthor = %s\n'832 'WHERE idSchedGroup = %s\n'833 ' AND tsExpire = \'infinity\'::TIMESTAMP\n',834 (uidAuthor, idScedGroup))835 if fNeedCommit:836 self._oDb.commit()837 return True838 836 839 837 # … … 878 876 ' enmScheduler,\n' 879 877 ' idBuildSrc,\n' 880 ' idBuildSrcTestSuite )\n' 881 'VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s )\n' 878 ' idBuildSrcTestSuite,\n' 879 ' sComment )\n' 880 'VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )\n' 882 881 , ( uidAuthor, 883 882 tsEffective, … … 888 887 oData.enmScheduler, 889 888 oData.idBuildSrc, 890 oData.idBuildSrcTestSuite, )); 889 oData.idBuildSrcTestSuite, 890 oData.sComment, )); 891 891 return True; 892 892 -
trunk/src/VBox/ValidationKit/testmanager/core/testcase.pgsql
r61468 r61472 32 32 DROP FUNCTION IF EXISTS del_testcase(INTEGER); 33 33 DROP FUNCTION IF EXISTS TestCaseLogic_delEntry(INTEGER, INTEGER); 34 DROP FUNCTION IF EXISTS TestCaseLogic_addEntry(a_uidAuthor INTEGER, a_sName TEXT, a_sDescription TEXT, 35 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 36 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT); 37 DROP FUNCTION IF EXISTS TestCaseLogic_editEntry(a_uidAuthor INTEGER, a_idTestCase INTEGER, a_sName TEXT, a_sDescription TEXT, 38 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 39 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT); 34 40 35 41 --- … … 96 102 $$ LANGUAGE plpgsql; 97 103 104 98 105 CREATE OR REPLACE function TestCaseLogic_addEntry(a_uidAuthor INTEGER, a_sName TEXT, a_sDescription TEXT, 99 106 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 100 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT) 107 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT, 108 a_sComment TEXT) 101 109 RETURNS INTEGER AS $$ 102 110 DECLARE … … 106 114 107 115 INSERT INTO TestCases (uidAuthor, sName, sDescription, fEnabled, cSecTimeout, 108 sTestBoxReqExpr, sBuildReqExpr, sBaseCmd, sTestSuiteZips )116 sTestBoxReqExpr, sBuildReqExpr, sBaseCmd, sTestSuiteZips, sComment) 109 117 VALUES (a_uidAuthor, a_sName, a_sDescription, a_fEnabled, a_cSecTimeout, 110 a_sTestBoxReqExpr, a_sBuildReqExpr, a_sBaseCmd, a_sTestSuiteZips )118 a_sTestBoxReqExpr, a_sBuildReqExpr, a_sBaseCmd, a_sTestSuiteZips, a_Comment) 111 119 RETURNING idTestcase INTO v_idTestCase; 112 120 RETURN v_idTestCase; … … 114 122 $$ LANGUAGE plpgsql; 115 123 124 116 125 CREATE OR REPLACE function TestCaseLogic_editEntry(a_uidAuthor INTEGER, a_idTestCase INTEGER, a_sName TEXT, a_sDescription TEXT, 117 126 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 118 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT) 127 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT, 128 a_sComment TEXT) 119 129 RETURNS INTEGER AS $$ 120 130 DECLARE … … 126 136 PERFORM TestCaseLogic_historizeEntry(a_idTestCase, CURRENT_TIMESTAMP); 127 137 INSERT INTO TestCases (idTestCase, uidAuthor, sName, sDescription, fEnabled, cSecTimeout, 128 sTestBoxReqExpr, sBuildReqExpr, sBaseCmd, sTestSuiteZips )138 sTestBoxReqExpr, sBuildReqExpr, sBaseCmd, sTestSuiteZips, sComment) 129 139 VALUES (a_idTestCase, a_uidAuthor, a_sName, a_sDescription, a_fEnabled, a_cSecTimeout, 130 a_sTestBoxReqExpr, a_sBuildReqExpr, a_sBaseCmd, a_sTestSuiteZips )140 a_sTestBoxReqExpr, a_sBuildReqExpr, a_sBaseCmd, a_sTestSuiteZips, a_sComment) 131 141 RETURNING idGenTestCase INTO v_idGenTestCase; 132 142 RETURN v_idGenTestCase; -
trunk/src/VBox/ValidationKit/testmanager/core/testcase.py
r61468 r61472 438 438 ksParam_sBaseCmd = 'TestCase_sBaseCmd' 439 439 ksParam_sValidationKitZips = 'TestCase_sValidationKitZips' 440 ksParam_sComment = 'TestCase_sComment' 440 441 441 442 kasAllowNullAttributes = [ 'idTestCase', 'tsEffective', 'tsExpire', 'uidAuthor', 'idGenTestCase', 'sDescription', 442 'sTestBoxReqExpr', 'sBuildReqExpr', 'sValidationKitZips', ]; 443 443 'sTestBoxReqExpr', 'sBuildReqExpr', 'sValidationKitZips', 'sComment' ]; 444 445 kcDbColumns = 14; 444 446 445 447 def __init__(self): … … 463 465 self.sBaseCmd = None; 464 466 self.sValidationKitZips = None; 467 self.sComment = None; 465 468 466 469 def initFromDbRow(self, aoRow): … … 485 488 self.sBaseCmd = aoRow[11]; 486 489 self.sValidationKitZips = aoRow[12]; 490 self.sComment = aoRow[13]; 487 491 return self; 488 492 … … 1148 1152 self._oDb.callProc('TestCaseLogic_addEntry', 1149 1153 ( uidAuthor, oData.sName, oData.sDescription, oData.fEnabled, oData.cSecTimeout, 1150 oData.sTestBoxReqExpr, oData.sBuildReqExpr, oData.sBaseCmd, oData.sValidationKitZips )); 1154 oData.sTestBoxReqExpr, oData.sBuildReqExpr, oData.sBaseCmd, oData.sValidationKitZips, 1155 oData.sComment )); 1151 1156 oData.idTestCase = self._oDb.fetchOne()[0]; 1152 1157 … … 1203 1208 self._oDb.callProc('TestCaseLogic_editEntry', ( uidAuthor, oData.idTestCase, oData.sName, oData.sDescription, 1204 1209 oData.fEnabled, oData.cSecTimeout, oData.sTestBoxReqExpr, 1205 oData.sBuildReqExpr, oData.sBaseCmd, oData.sValidationKitZips )); 1210 oData.sBuildReqExpr, oData.sBaseCmd, oData.sValidationKitZips, 1211 oData.sComment )); 1206 1212 oData.idGenTestCase = self._oDb.fetchOne()[0]; 1207 1213 -
trunk/src/VBox/ValidationKit/testmanager/core/testgroup.py
r61220 r61472 54 54 kiMax_iSchedPriority = 31; 55 55 56 kcDbColumns = 7; 56 57 57 58 def __init__(self): … … 133 134 TestGroupMemberData.initFromDbRow(self, aoRow); 134 135 self.oTestCase = TestCaseDataEx(); 135 self.oTestCase.initFromDbRowEx(aoRow[ 7:], oDb, tsNow);136 self.oTestCase.initFromDbRowEx(aoRow[TestGroupMemberData.kcDbColumns:], oDb, tsNow); 136 137 return self; 137 138 … … 168 169 def initFromDbRowEx(self, aoRow): 169 170 """ 170 Reinitialize from a :WRONG QUERY: 171 172 SELECT TestCases.idTestCase, 173 TestGroupMembers.tsEffective, 174 TestGroupMembers.tsExpire, 175 TestGroupMembers.uidAuthor, 176 TestCases.idGenTestCase, 177 TestCases.sName, 178 TestCases.sDescription, 179 TestCases.fEnabled, 180 TestCases.cSecTimeout, 181 TestCases.sBaseCmd, 182 TestCases.sValidationKitZips, 171 Reinitialize from this query: 172 173 SELECT TestCases.*, 183 174 TestGroupMembers.idTestGroup, 184 175 TestGroupMembers.aidTestCaseArgs … … 186 177 WHERE TestCases.idTestCase = TestGroupMembers.idTestCase 187 178 188 ..row.Represents complete test group member (test case) info.179 Represents complete test group member (test case) info. 189 180 Returns object of type TestGroupMemberData2. Raises exception if no row. 190 181 """ … … 208 199 ksParam_sName = 'TestGroup_sName' 209 200 ksParam_sDescription = 'TestGroup_sDescription' 210 211 kasAllowNullAttributes = ['idTestGroup', 'tsEffective', 'tsExpire', 'uidAuthor', 'sDescription' ]; 201 ksParam_sComment = 'TestGroup_sComment' 202 203 kasAllowNullAttributes = ['idTestGroup', 'tsEffective', 'tsExpire', 'uidAuthor', 'sDescription', 'sComment' ]; 204 205 kcDbColumns = 7; 212 206 213 207 def __init__(self): … … 224 218 self.sName = None 225 219 self.sDescription = None 220 self.sComment = None 226 221 227 222 def initFromDbRow(self, aoRow): … … 239 234 self.sName = aoRow[4] 240 235 self.sDescription = aoRow[5] 236 self.sComment = aoRow[6] 241 237 return self 242 238 … … 425 421 # Do the job. 426 422 # 427 self._oDb.execute('INSERT INTO TestGroups (uidAuthor, sName, sDescription )\n'423 self._oDb.execute('INSERT INTO TestGroups (uidAuthor, sName, sDescription, sComment)\n' 428 424 'VALUES (%s, %s, %s)\n' 429 425 'RETURNING idTestGroup\n' 430 426 , ( uidAuthor, 431 427 oData.sName, 432 oData.sDescription,)); 428 oData.sDescription, 429 oData.sComment, )); 433 430 idTestGroup = self._oDb.fetchOne()[0]; 434 431 oData.idTestGroup = idTestGroup; … … 464 461 self._historizeTestGroup(oData.idTestGroup); 465 462 self._oDb.execute('INSERT INTO TestGroups\n' 466 ' (uidAuthor, idTestGroup, sName, sDescription )\n'467 'VALUES (%s, %s, %s, %s )\n'463 ' (uidAuthor, idTestGroup, sName, sDescription, sComment)\n' 464 'VALUES (%s, %s, %s, %s, %s)\n' 468 465 , ( uidAuthor, 469 466 oData.idTestGroup, 470 467 oData.sName, 471 oData.sDescription, )); 468 oData.sDescription, 469 oData.sComment )); 472 470 473 471 # Create a lookup dictionary for old entries. … … 634 632 'WHERE tsExpire = \'infinity\'::timestamp\n' 635 633 ' AND idTestGroup = %s\n' 636 'ORDER BY idTestGroup ASC;', (idTestGroup,)) 634 'ORDER BY idTestGroup ASC;' 635 , (idTestGroup,)) 637 636 else: 638 637 self._oDb.execute('SELECT *\n' … … 641 640 ' AND tsEffective <= %s\n' 642 641 ' AND idTestGroup = %s\n' 643 'ORDER BY idTestGroup ASC;' ,644 (tsNow, tsNow, idTestGroup))642 'ORDER BY idTestGroup ASC;' 643 , (tsNow, tsNow, idTestGroup)) 645 644 646 645 aRows = self._oDb.fetchAll() -
trunk/src/VBox/ValidationKit/testmanager/db/TestManagerDatabaseInit.pgsql
r61468 r61472 301 301 -- @DOWNLOAD_BASE_URL@ prefix can be used to refer to this area. 302 302 sTestSuiteZips TEXT DEFAULT NULL, 303 304 -- Comment regarding a change or something. 305 sComment TEXT DEFAULT NULL, 303 306 304 307 PRIMARY KEY (idTestCase, tsExpire) … … 511 514 512 515 --- The name of the scheduling group. 513 sName textNOT NULL,516 sName TEXT NOT NULL, 514 517 --- Optional group description. 515 sDescription text, 518 sDescription TEXT, 519 -- Comment regarding a change or something. 520 sComment TEXT DEFAULT NULL, 516 521 517 522 PRIMARY KEY (idTestGroup, tsExpire) … … 604 609 605 610 --- The name of the scheduling group. 606 sName textNOT NULL,611 sName TEXT NOT NULL, 607 612 --- Optional group description. 608 sDescription text,613 sDescription TEXT, 609 614 --- Indicates whether this group is currently enabled. 610 615 fEnabled boolean NOT NULL, … … 619 624 -- Non-unique foreign key: BuildSources(idBuildSrc) 620 625 idBuildSrcTestSuite INTEGER DEFAULT NULL, 626 -- Comment regarding a change or something. 627 sComment TEXT DEFAULT NULL, 621 628 622 629 PRIMARY KEY (idSchedGroup, tsExpire) -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadminschedgroup.py
r56295 r61472 84 84 fReadOnly = self._sMode == WuiFormContentBase.ksMode_Show); 85 85 86 oForm.addMultilineText (SchedGroupData.ksParam_sComment, oData.sComment, 'Comment'); 86 87 oForm.addSubmit() 87 88 … … 100 101 self._asColumnHeaders = [ 101 102 'ID', 'Name', 'Enabled', 'Scheduler Type', 102 'Build Source', 'Validation Kit Source', 'Test Groups', 'TestBoxes', ' Actions',103 'Build Source', 'Validation Kit Source', 'Test Groups', 'TestBoxes', 'Note', 'Actions', 103 104 ]; 104 105 105 106 self._asColumnAttribs = [ 106 107 'align="right"', 'align="center"', 'align="center"', 'align="center"', 107 'align="center"', 'align="center"', '', '', 'align="center"', 108 'align="center"', 'align="center"', '', '', 'align="center"', 'align="center"', 108 109 ]; 109 110 … … 181 182 aoMembers, 182 183 aoTestBoxes, 184 self._formatCommentCell(oEntry.sComment), 183 185 aoActions, 184 186 ]; -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestbox.py
r61468 r61472 235 235 fBracketed = False); 236 236 # Comment 237 oComment = None; 238 if oEntry.sComment is not None: 239 sComment = oEntry.sComment.strip(); 240 if len(sComment) > 64: 241 oComment = WuiRawHtml('<span title="%s">%s...</span>' 242 % (webutils.escapeAttr(sComment), webutils.escapeElem(sComment[:60]),)); 243 elif len(sComment) > 0: 244 oComment = WuiRawHtml(webutils.escapeElem(sComment)); 237 oComment = self._formatCommentCell(oEntry.sComment); 245 238 246 239 # Group link. -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestcase.py
r61272 r61472 64 64 self._asColumnHeaders = \ 65 65 [ 66 'Name', 'Active', ' DefaultTimeout', 'Base Command / Variations', 'Validation Kit Files',67 'Test Case Prereqs', 'Global R esources', 'Actions'66 'Name', 'Active', 'Timeout', 'Base Command / Variations', 'Validation Kit Files', 67 'Test Case Prereqs', 'Global Rsrces', 'Note', 'Actions' 68 68 ]; 69 69 self._asColumnAttribs = \ 70 70 [ 71 '', '', ' ', '', '',72 'valign="top"', 'valign="top"', 'align="center"' 71 '', '', 'align="center"', '', '', 72 'valign="top"', 'valign="top"', 'align="center"', 'align="center"' 73 73 ]; 74 74 … … 154 154 aoRet.append(WuiRawHtml(sHtml)); 155 155 156 # Comment (note). 157 aoRet.append(self._formatCommentCell(oEntry.sComment)); 158 156 159 # Show actions that can be taken. 157 160 aoActions = [ WuiTmLink('Details', WuiAdmin.ksScriptName, … … 237 240 oForm.addListOfResources(TestCaseDataEx.ksParam_aoDepGlobalResources, aoGlobalResrcDeps, 'Depends on resources') 238 241 242 oForm.addMultilineText(TestCaseDataEx.ksParam_sComment, oData.sComment, 'Comment'); 243 239 244 oForm.addSubmit(); 240 245 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestgroup.py
r56295 r61472 74 74 fReadOnly = self._sMode == WuiFormContentBase.ksMode_Show); 75 75 76 oForm.addMultilineText (TestGroupData.ksParam_sComment, self._oData.sComment, 'Comment'); 76 77 oForm.addSubmit(); 77 78 return True; … … 88 89 WuiListContentBase.__init__(self, aoEntries, iPage, cItemsPerPage, tsEffective, 89 90 sTitle = 'Test Groups', fnDPrint = fnDPrint, oDisp = oDisp); 90 self._asColumnHeaders = [ 'ID', 'Name', 'Description', 'Test Cases', ' Actions' ];91 self._asColumnAttribs = [ 'align="right"', '', '', '', 'align="center"' ];91 self._asColumnHeaders = [ 'ID', 'Name', 'Description', 'Test Cases', 'Note', 'Actions' ]; 92 self._asColumnAttribs = [ 'align="right"', '', '', '', 'align="center"', 'align="center"' ]; 92 93 93 94 … … 178 179 oEntry.sDescription if oEntry.sDescription is not None else '', 179 180 oTestCases, 181 self._formatCommentCell(oEntry.sComment, cMaxLines = max(3, len(oEntry.aoMembers) * 2)), 180 182 aoActions ]; 181 183 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py
r61424 r61472 203 203 Outputs the given text within a span of the given CSS class. 204 204 """ 205 def __init__(self, sSpanClass, sText): 206 WuiRawHtml.__init__(self, 207 u'<span class="%s">%s</span>' 208 % (webutils.escapeAttr(sSpanClass), webutils.escapeElem(sText),)); 205 def __init__(self, sSpanClass, sText, sTitle = None): 206 if sTitle is None: 207 WuiRawHtml.__init__(self, 208 u'<span class="%s">%s</span>' 209 % ( webutils.escapeAttr(sSpanClass), webutils.escapeElem(sText),)); 210 else: 211 WuiRawHtml.__init__(self, 212 u'<span class="%s" title="%s">%s</span>' 213 % ( webutils.escapeAttr(sSpanClass), webutils.escapeAttr(sTitle), webutils.escapeElem(sText),)); 214 209 215 210 216 … … 692 698 self._asColumnAttribs = []; 693 699 700 def _formatCommentCell(self, sComment, cMaxLines = 3, cchMaxLine = 63): 701 """ 702 Helper functions for formatting comment cell. 703 Returns None or WuiRawHtml instance. 704 """ 705 # Nothing to do for empty comments. 706 if sComment is None: 707 return None; 708 sComment = sComment.strip(); 709 if len(sComment) == 0: 710 return None; 711 712 # Restrict the text if necessary, making the whole text available thru mouse-over. 713 ## @todo this would be better done by java script or smth, so it could automatically adjust to the table size. 714 if len(sComment) > cchMaxLine or sComment.count('\n') >= cMaxLines: 715 sShortHtml = ''; 716 for iLine, sLine in enumerate(sComment.split('\n')): 717 if iLine >= cMaxLines: 718 break; 719 if iLine > 0: 720 sShortHtml += '<br>\n'; 721 if len(sLine) > cchMaxLine: 722 sShortHtml += webutils.escapeElem(sLine[:(cchMaxLine - 3)]); 723 sShortHtml += '...'; 724 else: 725 sShortHtml += webutils.escapeElem(sLine); 726 return WuiRawHtml('<span class="tmcomment" title="%s">%s</span>' % (webutils.escapeAttr(sComment), sShortHtml,)); 727 728 return WuiRawHtml('<span class="tmcomment">%s</span>' % (webutils.escapeElem(sComment).replace('\n', '<br>'),)); 729 694 730 def _formatListEntry(self, iEntry): 695 731 """
Note:
See TracChangeset
for help on using the changeset viewer.