Changeset 4557 for Serveur


Ignore:
Timestamp:
12/03/10 13:59:39 (8 years ago)
Author:
kent1
Message:

Les fonctions d'upgrade d'environnement etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Serveur/trac/Piwik4Trac/tracext/piwik/__init__.py

    r4009 r4557  
    6363    def environment_created(self):
    6464        "Nothing to do when an environment is created"""
     65   
     66    def environment_needs_upgrade(self, db):
     67        return 'piwik' in self.config
    6568
     69    def upgrade_environment(self, db):
     70        # Although we're only migrating configuration stuff and there's no
     71        # database queries involved, which could be done on other places,
     72        # I'm placing the migration code here so that it only happens once
     73        # and the admin notices that a migration was done.
     74        self.log.debug('Migrating Piwik configuration')
     75        for option, value in self.config.options('piwik'):
     76            if self.config.has_option('piwik', option):
     77                self.config.set('piwik', option, value)
     78            self.config.remove('piwik', option)
     79        self.config.save()
Note: See TracChangeset for help on using the changeset viewer.