本文整理汇总了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)
示例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',
]
示例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