Skip to content

Commit

Permalink
Moved getAccountViewFromEmail to the base login (right place?)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Castellano authored and Boris 'billiob' Faure committed Jun 29, 2009
1 parent 6b66ee9 commit ea41c23
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
16 changes: 16 additions & 0 deletions amsn2/gui/base/login.py
Expand Up @@ -35,4 +35,20 @@ def onConnecting(self, progress, message):
@param message: the message to show while loging in """
raise NotImplementedError

def getAccountViewFromEmail(self, email):
"""
Search in the list self._account_views and return the view of the given email
@type email: str
@param email: email to find
@rtype: AccountView
@return: Returns AccountView if it was found, otherwise return None
"""

accv = [accv for accv in self._account_views if accv.email == email]

if len(accv) == 0:
return None
else:
return accv[0]

17 changes: 0 additions & 17 deletions amsn2/gui/front_ends/gtk/login.py
Expand Up @@ -294,20 +294,3 @@ def __on_toggled_cb(self, source):
elif source is self.autoLogin:
accv.autologin = source.get_active()


def getAccountViewFromEmail(self, email):
"""
Search in the list of account views and return the view of the given email
@type email: str
@param email: email to find
@rtype: AccountView
@return: Returns AccountView if it was found, otherwise return None
"""

accv = [accv for accv in self._account_views if accv.email == email]

if len(accv) == 0:
return None
else:
return accv[0]

0 comments on commit ea41c23

Please sign in to comment.