diff src/memory/params.py @ 1460:c7fd121a6180

core: getProfileName no raise ProfileUnknownError + minor doc fixes
author Goffi <goffi@goffi.org>
date Sun, 16 Aug 2015 00:41:58 +0200
parents 3265a2639182
children ac522c4dab0e
line wrap: on
line diff
--- a/src/memory/params.py	Sun Aug 16 00:39:44 2015 +0200
+++ b/src/memory/params.py	Sun Aug 16 00:41:58 2015 +0200
@@ -186,7 +186,9 @@
                             @ALL@ for all profiles
                             @DEFAULT@ for default profile
         @param return_profile_keys: if True, return unmanaged profile keys (like "@ALL@"). This keys must be managed by the caller
-        @return: requested profile name or emptry string if it doesn't exist"""
+        @return: requested profile name
+        @raise exceptions.ProfileUnknownError if profile doesn't exists
+        """
         if profile_key == '@DEFAULT@':
             default = self.host.memory.memory_data.get('Profile_default')
             if not default:
@@ -203,7 +205,7 @@
             return profile_key # this value must be managed by the caller
         if not self.storage.hasProfile(profile_key):
             log.error(_(u'Trying to access an unknown profile (%s)') % profile_key)
-            return "" # FIXME: raise exceptions.ProfileUnknownError here (must be well checked, this method is used in lot of places)
+            raise exceptions.ProfileUnknownError
         return profile_key
 
     def __get_unique_node(self, parent, tag, name):