core (memory, params): minor docstrings updates

This commit is contained in:
Goffi 2015-09-25 19:19:12 +02:00
commit 74d91860ad
2 changed files with 6 additions and 6 deletions

View file

@ -356,9 +356,9 @@ class Memory(object):
def getProfileName(self, profile_key, return_profile_keys=False):
"""Return name of profile from keyword
@param profile_key: can be the profile name or a keywork (like @DEFAULT@)
@param profile_key: can be the profile name or a keyword (like @DEFAULT@)
@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
"""
return self.params.getProfileName(profile_key, return_profile_keys)

View file

@ -190,9 +190,9 @@ class Params(object):
"""return profile according to profile_key
@param profile_key: profile name or key which can be
@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
C.PROF_KEY_ALL for all profiles
C.PROF_KEY_DEFAULT for default profile
@param return_profile_keys: if True, return unmanaged profile keys (like C.PROF_KEY_ALL). This keys must be managed by the caller
@return: requested profile name
@raise exceptions.ProfileUnknownError if profile doesn't exists
"""
@ -208,7 +208,7 @@ class Params(object):
return default # FIXME: temporary, must use real default value, and fallback to first one if it doesn't exists
elif profile_key == C.PROF_KEY_NONE:
raise exceptions.ProfileNotSetError
elif return_profile_keys and profile_key in ["@ALL@"]:
elif return_profile_keys and profile_key in [C.PROF_KEY_ALL]:
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)