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


Python DITICConfig.get_list_status方法代码示例

本文整理汇总了Python中ditic_kanban.config.DITICConfig.get_list_status方法的典型用法代码示例。如果您正苦于以下问题:Python DITICConfig.get_list_status方法的具体用法?Python DITICConfig.get_list_status怎么用?Python DITICConfig.get_list_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ditic_kanban.config.DITICConfig的用法示例。


在下文中一共展示了DITICConfig.get_list_status方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate_summary_file

# 需要导入模块: from ditic_kanban.config import DITICConfig [as 别名]
# 或者: from ditic_kanban.config.DITICConfig import get_list_status [as 别名]
def generate_summary_file():
    """
    We need this function in order to test the real generate_summary_file function. Its name has been changed to __...
    :return: the time necessary to execute this function
    """
    start_time = time()

    # Read configuration
    config = DITICConfig()

    # List of emails
    list_emails = set(config.get_email_to_user().keys())

    # List of possible status
    list_status = config.get_list_status()

    # Let use system config list
    system = config.get_system()

    rt_object = RTApi(system['server'], system['username'], system['password'])

    summary = __generate_summary_file(rt_object, list_emails, list_status)

    # The summary of all files will be flushed to this file.
    try:
        with open(summary_filename(system['working_dir'], system['summary_file']), 'w') as file_handler:
            dump(summary, file_handler)
    except IOError as e:
        raise IOError('Error:' + str(e))

    return '%0.2f seconds' % (time() - start_time)
开发者ID:tomascarvalho,项目名称:ES,代码行数:33,代码来源:rt_summary.py

示例2: test_get_list_status

# 需要导入模块: from ditic_kanban.config import DITICConfig [as 别名]
# 或者: from ditic_kanban.config.DITICConfig import get_list_status [as 别名]
def test_get_list_status():
    test_config = DITICConfig()
    test_config.list_status = [
            'new',
            'open',
    ]
    response = test_config.get_list_status()
    assert response == [
            'new',
            'open',
    ]
开发者ID:tomascarvalho,项目名称:ES,代码行数:13,代码来源:test_config.py

示例3: get_summary_info

# 需要导入模块: from ditic_kanban.config import DITICConfig [as 别名]
# 或者: from ditic_kanban.config.DITICConfig import get_list_status [as 别名]
def get_summary_info():
    """
    returns a dictionary with the following format
        {
            'email':
                {
                    'status': 'value',
                    ...
                }
            ...
        }
    :return:
    """
    #generate_summary_file() #retirar o comando generate_summary_file
    #stats_update_json_file() # retirar o comando update_statistics



    # Read configuration
    config = DITICConfig()

    # List of known emails
    list_emails = config.get_email_to_user().keys()

    # List of known status
    list_status = config.get_list_status()

    # Let use system config list
    system = config.get_system()

    # Get the file information
    try:
        with open(summary_filename(system['working_dir'], system['summary_file']), 'r') as file_handler:
            summary = load(file_handler)
    except IOError:
        # If there is an error, then return everything zeroed
        summary = {email: {status: 0 for status in list_status} for email in list_emails}
        summary['dir'] = {status: 0 for status in list_status}
        summary['dir-inbox'] = {status: 0 for status in list_status}
        summary['unknown'] = {status: 0 for status in list_status}

    return summary
开发者ID:tomascarvalho,项目名称:ES,代码行数:44,代码来源:rt_summary.py


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