Changeset 7749 for main/waeup.sirp/trunk/src
- Timestamp:
- 2 Mar 2012, 10:32:47 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/batchprocessing.txt
r7705 r7749 142 142 ...File:...faculties_zope.mgr.csv... 143 143 144 We can watchthe entries generated in logfile:144 We can grep the entries generated in logfile: 145 145 146 146 >>> browser.getControl('View processing log').click() 147 147 >>> print browser.contents 148 148 <!DOCTYPE ... 149 <pre>... 150 151 ... - INFO - -------------------- 152 ... - INFO - zope.mgr: Batch processing finished: OK 153 ... - INFO - zope.mgr: Source: /.../faculties_zope.mgr.csv 154 ... - INFO - zope.mgr: Mode: create 155 ... - INFO - zope.mgr: User: zope.mgr 156 ... - INFO - zope.mgr: Processing time: ... s (... s/item) 157 ... - INFO - zope.mgr: Processed: 3 lines (3 successful/ 0 failed) 158 ... - INFO - -------------------- 159 </pre> 160 .... 149 ...<h1>Logfile datacenter.log</h1>... 150 151 >>> browser.getControl(name='query').value = "zope.mgr" 152 >>> browser.getControl('Search').click() 153 >>> 'zope.mgr: Batch processing finished: OK' in browser.contents 154 True 155 >>> 'Mode: create' in browser.contents 156 True 157 158 >>> browser.getControl(name='query').value = "finished" 159 >>> browser.getControl('Search').click() 160 >>> 'zope.mgr: Batch processing finished: OK' in browser.contents 161 True 162 >>> 'Mode: create' in browser.contents 163 False 161 164 162 165 … … 564 567 True 565 568 >>> browser.getControl('Show', index=0).click() 566 >>> '<input class="btn primary" type="submit" name="back" value="Back" />' in browser.contents567 True568 569 >>> browser.getControl('Back', index=0).click() 569 570 >>> browser.getControl('Back to Data Center').click() -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7741 r7749 1140 1140 title = _(u'Data Center') 1141 1141 pnav = 0 1142 search_button = _('Search') 1143 back_button = _('Back') 1142 1144 1143 1145 def label(self): 1144 1146 return "Logfile %s" % self.filename 1145 1147 1146 def update(self, show=None, remove=None, back=None):1148 def update(self, back=None, query=None): 1147 1149 session = ISession(self.request)['waeup.sirp'] 1148 1150 logname = session.get('logname', None) … … 1151 1153 return 1152 1154 self.filename = logname 1155 form = self.request.form 1156 self.query = '' 1157 query = form.get('query') 1158 if search is None or not query: 1159 return 1153 1160 self.files = self.context.getLogFiles() 1154 1161 fullpath = os.path.join(self.context.storage, 'logs', logname) 1155 self.filecontents = open(fullpath, 'rb').read() 1162 1163 self.query = query 1164 #self.filecontents = open(fullpath, 'rb').read() 1165 popen = os.popen('grep %s %s' % (query,fullpath)) 1166 self.grepresult = popen.read() 1167 popen.close() 1156 1168 1157 1169 class DatacenterSettings(SIRPPage): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/datacenterlogsshowfilepage.pt
r7465 r7749 1 <form method="POST"> 2 <input class="btn primary" type="submit" name="back" value="Back" /> 1 <form method="post"> 2 <input type="text" name="query" 3 tal:attributes="value view/query" /> 4 <input class="btn primary" type="submit" name="search" 5 tal:attributes="value view/search_button"/> 6 <input class="btn" type="submit" name="back" 7 tal:attributes="value view/back_button"/> 3 8 </form> 4 9 5 <div >6 <pre tal:content=" view/filecontents">7 blah, blah10 <div tal:condition="view/grepresult|nothing"> 11 <pre tal:content="structure view/grepresult"> 12 GREPRESULT 8 13 </pre> 9 14 </div> 10 11 <form method="POST">12 <input class="btn primary" type="submit" name="back" value="Back" />13 </form>
Note: See TracChangeset for help on using the changeset viewer.