本文整理匯總了Python中WRCCUtils.load_json_data_from_file方法的典型用法代碼示例。如果您正苦於以下問題:Python WRCCUtils.load_json_data_from_file方法的具體用法?Python WRCCUtils.load_json_data_from_file怎麽用?Python WRCCUtils.load_json_data_from_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WRCCUtils
的用法示例。
在下文中一共展示了WRCCUtils.load_json_data_from_file方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: start_logger
# 需要導入模塊: import WRCCUtils [as 別名]
# 或者: from WRCCUtils import load_json_data_from_file [as 別名]
time_out = now - datetime.timedelta(minutes=d)
#Start Logging
logger, log_file_name = start_logger(base_dir)
#Get list ofparameter files
params_files = get_params_files(base_dir)
if not params_files:
logger.info('No parameter files found! Exiting program.')
sys.exit(0)
logger.info('Found %s parameter files.' %str(len(params_files)))
#Loop over parameter files, get data, format and write to ftp server, notify user
params_files_failed = []
for idx, params_file in enumerate(params_files):
logger.info('Parameter file: %s' % os.path.basename(params_file))
time_stamp = datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S_%f')
params = WRCCUtils.load_json_data_from_file(params_file)
if not params:
logger.error('Could not load data parameter file!')
else:
logger.info('Parameters: %s' % str(params))
#Extra directory for each request
ftp_dir = settings.DRI_PUB_DIR + params['output_file_name'].replace(' ','')
if not params:
logger.error('Cannot read parameter file: %s! Exiting program.' %os.path.basename(params_file))
params_files_failed.append(params_file)
continue
#Check if params file is older than
#cron job time --> data request completed or in progress
#Check if request in progress
st=os.stat(params_file)