Changeset 8515


Ignore:
Timestamp:
25 May 2012, 01:39:32 (12 years ago)
Author:
uli
Message:

Use new logfile search and shorten some overlong lines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r8511 r8515  
    680680        return
    681681
    682     @action(_('Add session configuration'), validator=NullValidator, style='primary')
     682    @action(_('Add session configuration'), validator=NullValidator,
     683            style='primary')
    683684    def addSubunit(self, **data):
    684685        self.redirect(self.url(self.context, '@@add'))
     
    691692            url = self.url(val)
    692693            session_string = val.getSessionString()
    693             title = _('Session ${a} Configuration', mapping = {'a':session_string})
     694            title = _('Session ${a} Configuration',
     695                      mapping = {'a':session_string})
    694696            yield(dict(url=url, name=key, title=title))
    695697
     
    12441246        if search is None or not query:
    12451247            return
    1246         self.files = self.context.getLogFiles()
    1247         fullpath = os.path.join(self.context.storage, 'logs', logname)
    12481248        self.query = query
    1249         #self.filecontents = open(fullpath, 'rb').read()
    1250         popen = os.popen("grep '%s' %s" % (query,fullpath))
    1251         self.grepresult = popen.read()
    1252         popen.close()
     1249        try:
     1250            self.grepresult = ''.join(
     1251                self.context.queryLogfiles(logname, query))
     1252        except ValueError:
     1253            self.flash(_('Not a valid search expression.' ))
     1254        return
    12531255
    12541256class DatacenterSettings(KofaPage):
Note: See TracChangeset for help on using the changeset viewer.