本文整理汇总了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