我就废话不多说了,大家还是直接看代码吧!
# coding=utf-8
import logging
import yaml
import os
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
# 获取当前目录的路径
cur_dir = os.path.abspath('.')
def check_dt_pacsscp(config):
"""
用来检查文件配置是否正确
"""
#将配置config.yaml配置文件以字典方式读取
dts_method = config['service']['method']
dts_dup_check = config['service']['pacsscp_dup_check_off']
dts_interval = config['scheduler']['interval']
#判断对接方式是否是pacsscp
if dts_method == 'pacsscp':
if dts_dup_check == True and dts_interval == 3:
return True
else:
return False
else:
#打印error级别的错误
print "\033[31m Error:method not