本文整理汇总了Python中account.Account.set_section_id方法的典型用法代码示例。如果您正苦于以下问题:Python Account.set_section_id方法的具体用法?Python Account.set_section_id怎么用?Python Account.set_section_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类account.Account
的用法示例。
在下文中一共展示了Account.set_section_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_default_account
# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import set_section_id [as 别名]
def get_default_account(cls):
# we are not going to set the id, because we never save this
url = 'blogtest.letseatalready.com'
username = 'test'
password = 'test'
default_account = Account(url, username, password)
default_account.set_section_id(AccountManager.DEFAULT_ACCOUNT_ID)
return default_account
示例2: __load_accounts_from_config
# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import set_section_id [as 别名]
def __load_accounts_from_config(self):
for section in self.__config.sections():
section_id = self.__next_id()
url = self.__config.get(section, 'url')
username = self.__config.get(section, 'username')
try:
password = self.__config.get(section, 'password')
if password == '': password = None
except NoOptionError:
password = None
new_account = Account(url, username, password)
new_account.set_section_id(section_id)
self.__set_section_id_and_load_account(new_account)
示例3: test_print_accounts
# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import set_section_id [as 别名]
def test_print_accounts(self):
account = Account('url', 'username', 'password')
account.set_section_id(1)
expected = "ACCOUNTS\nEnter the number next to the desired account.\n(**latest) N = New, D = Delete\n1. [email protected] **"
result = self.display._Display__print_accounts([account], 1, False)
self.assertEqual(result, expected)