Skip to content

Commit

Permalink
Implementado método para obtener los "EmailServers" de un "Account" #2
Browse files Browse the repository at this point in the history
Se ha implementado un método para que dado un Account y un Protocol
(SMTP, IMAP ó POP3) se obtenga el EmailServer de los mismos.
  • Loading branch information
juanrarodriguez18 committed Oct 11, 2017
1 parent 9aff8d5 commit 00867a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions repository/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def get_all():
smtp_server_port = emailServer.getPort()
user = db.searchUser(config['Telegram']['ADMIN_ID'])
from_email = user.getAccounts()[0].getUsername()
print(from_email)
from_pwd = user.getAccounts()[0].getPassword()
print(from_pwd)
admin_id = user.getId()

u_content = UserContent()
Expand Down
8 changes: 6 additions & 2 deletions repository/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from tinydb import TinyDB, Query
from repository.EmailServer import EmailServer
from repository.User import User
from repository.Account import Account,parseAccountsToJson,parseJsonToAccounts
from repository.Account import parseAccountsToJson,parseJsonToAccounts

class DBC:
def __init__(self, path=None):
Expand Down Expand Up @@ -82,4 +82,8 @@ def updateAccountOfUser(self, user, account):
def removeAccountOfUser(self, user, account):
user = self.searchUser(user.getId())
user.removeAccount(account)
self.updateUser(user)
self.updateUser(user)

def getEmailServerOfAccount(self, account, protocol):
emailServer = self.searchEmailServer(account.getName(), protocol)
return emailServer

0 comments on commit 00867a4

Please sign in to comment.