当前位置: 首页>>代码示例>>Python>>正文


Python Account.set_section_id方法代码示例

本文整理汇总了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
开发者ID:jackdesert,项目名称:lyxblogger_oo,代码行数:10,代码来源:account_manager.py

示例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)
开发者ID:jackdesert,项目名称:lyxblogger_oo,代码行数:15,代码来源:account_manager.py

示例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)
开发者ID:jackdesert,项目名称:lyxblogger_oo,代码行数:8,代码来源:test_display.py


注:本文中的account.Account.set_section_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。