comparison src/memory/sqlite.py @ 1019:6a16ec17a458

better PEP-8 compliance
author souliane <souliane@mailoo.org>
date Wed, 07 May 2014 15:44:31 +0200
parents 301b342c697a
children 15f43b54d697
comparison
equal deleted inserted replaced
1018:e22e4cf86204 1019:6a16ec17a458
125 125
126 def _updateDb(self, interaction, statements): 126 def _updateDb(self, interaction, statements):
127 for statement in statements: 127 for statement in statements:
128 interaction.execute(statement) 128 interaction.execute(statement)
129 129
130
131 #Profiles 130 #Profiles
132 def _profilesCache(self, profiles_result): 131 def _profilesCache(self, profiles_result):
133 """Fill the profiles cache 132 """Fill the profiles cache
134 @param profiles_result: result of the sql profiles query""" 133 @param profiles_result: result of the sql profiles query"""
135 for profile in profiles_result: 134 for profile in profiles_result:
542 raise exceptions.DatabaseError("Database mismatch") 541 raise exceptions.DatabaseError("Database mismatch")
543 else: 542 else:
544 # Database is not up-to-date, we'll do the update 543 # Database is not up-to-date, we'll do the update
545 log.info(_("Database schema has changed, local database will be updated")) 544 log.info(_("Database schema has changed, local database will be updated"))
546 update_raw = [] 545 update_raw = []
547 for version in xrange(local_version+1, CURRENT_DB_VERSION+1): 546 for version in xrange(local_version + 1, CURRENT_DB_VERSION + 1):
548 try: 547 try:
549 update_data = DATABASE_SCHEMAS[version] 548 update_data = DATABASE_SCHEMAS[version]
550 except KeyError: 549 except KeyError:
551 raise exceptions.InternalError("Missing update definition (version %d)" % version) 550 raise exceptions.InternalError("Missing update definition (version %d)" % version)
552 update_raw.extend(self.update2raw(update_data)) 551 update_raw.extend(self.update2raw(update_data))