Ignore:
Timestamp:
9 Nov 2012, 07:53:05 (12 years ago)
Author:
Henrik Bettermann
Message:

Show only last 100 finished files.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/batchprocessing.txt

    r9420 r9589  
    641641
    642642    >>> browser.open('http://localhost/app/datacenter/processed')
    643     >>> '<a href="download?filename=finished/certificates_zope.mgr.csv">' in browser.contents
     643    >>> '<a href="download?filename=finished/certificates_zope.mgr.create.finished.csv">' in browser.contents
    644644    True
    645645
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterfinishedpage.pt

    r9195 r9589  
    11<table i18n:domain="waeup.kofa" class="display dataTableFiles">
     2  <p i18n:translate="">
     3    Find below the last
     4    <span tal:content="view/context/max_files" i18n:name="count">50</span>
     5    imports. The files contain the imported datasets.
     6  </p>
    27  <thead>
    38    <tr>
  • main/waeup.kofa/trunk/src/waeup/kofa/datacenter.py

    r9340 r9589  
    2222"""
    2323import os
     24import fnmatch
    2425import re
    2526import shutil
     
    4647    logger_filename = 'datacenter.log'
    4748
     49    max_files = 100
     50
    4851    def __init__(self, *args, **kw):
    4952        super(DataCenter, self).__init__(*args, **kw)
     
    97100        if not os.path.exists(finished_dir):
    98101            return result
    99         for filename in sorted(os.listdir(finished_dir)):
     102        mtime = lambda f: os.stat(os.path.join(finished_dir, f)).st_mtime
     103        finished_files = [f for f in
     104            sorted(os.listdir(finished_dir), key=mtime, reverse=True)
     105            if fnmatch.fnmatch(f, '*.finished.csv')]
     106        for filename in finished_files[:self.max_files]:
    100107            fullpath = os.path.join(finished_dir, filename)
    101108            if not os.path.isfile(fullpath):
  • main/waeup.kofa/trunk/src/waeup/kofa/datacenter.txt

    r9023 r9589  
    276276
    277277    >>> mydatacenter.getFinishedFiles()
    278     [<waeup.kofa.datacenter.DataCenterFile object at ...>, <waeup.kofa.datacenter.DataCenterFile object at ...>]
     278    [<waeup.kofa.datacenter.DataCenterFile object at ...>]
    279279
    280280    >>> datafile = mydatacenter.getFinishedFiles()[0]
Note: See TracChangeset for help on using the changeset viewer.