diff src/memory/memory.py @ 566:9faccd827657

core: sqlite storage constraint fix
author Goffi <goffi@goffi.org>
date Mon, 07 Jan 2013 00:57:50 +0100
parents 4f856dd4c0d0
children ca13633d3b6b
line wrap: on
line diff
--- a/src/memory/memory.py	Mon Jan 07 00:56:13 2013 +0100
+++ b/src/memory/memory.py	Mon Jan 07 00:57:50 2013 +0100
@@ -141,7 +141,7 @@
         @param profile: profile of the profile"""
         #FIXME: must be asynchronous and call the callback once the profile actually exists
         if self.storage.hasProfile(profile):
-            info (_('The profile profile already exists'))
+            info (_('The profile [%s] already exists') % (profile,))
             return True
         if not self.host.trigger.point("ProfileCreation", profile):
             return False
@@ -679,7 +679,7 @@
         """Add an identity discovered from server
         @param feature: string of the feature
         @param profile: which profile is using this server ?"""
-        if not self.server_identities.has_key(profile):
+        if not profile in self.server_identities:
             self.server_identities[profile] = {}
         if not self.server_identities[profile].has_key((category, _type)):
             self.server_identities[profile][(category, _type)]=set()
@@ -687,7 +687,7 @@
 
     def getServerServiceEntities(self, category, _type, profile):
         """Return all available entities for a service"""
-        if self.server_identities.has_key(profile):
+        if profile in self.server_identities:
             return self.server_identities[profile].get((category, _type), set())
         else:
             return None