Changeset 9bb40d in indico


Ignore:
Timestamp:
03/16/11 09:08:08 (2 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
9abde2
Parents:
23945f
Message:

[FIX] Logging in statistics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/statistics.py

    r078f40 r9bb40d  
    9393    def _updateStatistics(cls, cat, dbi, level=0, logger=None): 
    9494 
    95         ncat = 0 
    9695        statistics = cat.getStatistics() 
    9796        statistics["events"] = {} 
     
    102101            for cat in cat.getSubCategoryList(): 
    103102                cat._p_changed = 1 
     103 
     104                # only at top level 
     105                if level == 0 and logger: 
     106                    logger.info("Processing '%s' (%s)" % (cat.getTitle(), 
     107                                                          cat.getId())) 
     108 
    104109                cls._updateStatistics(cat, dbi, level + 1, logger) 
    105110                # commit after each category 
     
    118123                statistics["resources"] += cat._statistics["resources"] 
    119124 
    120                 ncat += 1 
    121  
    122                 # only at top level 
    123                 if level == 0: 
    124                     # notify each 100 categories: 
    125                     if logger and ncat > 0 and ncat % 100 == 0: 
    126                         logger.info("%d categories already processed" % ncat) 
    127  
    128125        elif len(cat.getConferenceList()) > 0: 
    129126            for event in cat.getConferenceList(): 
Note: See TracChangeset for help on using the changeset viewer.