本文整理匯總了Python中inbox.models.backends.gmail.GmailAccount.password方法的典型用法代碼示例。如果您正苦於以下問題:Python GmailAccount.password方法的具體用法?Python GmailAccount.password怎麽用?Python GmailAccount.password使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類inbox.models.backends.gmail.GmailAccount
的用法示例。
在下文中一共展示了GmailAccount.password方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: add_fake_gmail_account
# 需要導入模塊: from inbox.models.backends.gmail import GmailAccount [as 別名]
# 或者: from inbox.models.backends.gmail.GmailAccount import password [as 別名]
def add_fake_gmail_account(
db_session, email_address="[email protected]", refresh_token="tearsofgold", password="COyPtHmj9E9bvGdN"
):
from inbox.models import Namespace
from inbox.models.backends.gmail import GmailAccount
import platform
with db_session.no_autoflush:
namespace = Namespace()
account = GmailAccount(
email_address=email_address, refresh_token=refresh_token, sync_host=platform.node(), namespace=namespace
)
account.password = password
db_session.add(account)
db_session.commit()
return account
示例2: gmail_account
# 需要導入模塊: from inbox.models.backends.gmail import GmailAccount [as 別名]
# 或者: from inbox.models.backends.gmail.GmailAccount import password [as 別名]
def gmail_account(db):
import platform
from inbox.models import Namespace
from inbox.models.backends.gmail import GmailAccount
account = db.session.query(GmailAccount).first()
if account is None:
with db.session.no_autoflush:
namespace = Namespace()
account = GmailAccount(
email_address='[email protected]',
refresh_token='tearsofgold',
sync_host=platform.node(),
namespace=namespace)
account.password = 'COyPtHmj9E9bvGdN'
db.session.add(account)
db.session.commit()
return account