本文整理汇总了Python中Formatter.dataComplex方法的典型用法代码示例。如果您正苦于以下问题:Python Formatter.dataComplex方法的具体用法?Python Formatter.dataComplex怎么用?Python Formatter.dataComplex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formatter
的用法示例。
在下文中一共展示了Formatter.dataComplex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: conversion
# 需要导入模块: import Formatter [as 别名]
# 或者: from Formatter import dataComplex [as 别名]
try:
#government webservice conversion (these guys aren't aware of international country codes)
language = lan
if (language == 'es'):
language = 'sp'
url = '%s&mainSearchCriteria.v.c=%s&informationRecipient.languageCode.c=%s' % (AppConfig.medlinePlusHealthDiagnosisICD9URL, query, language)
rpcDiagnosis = urlfetch.create_rpc()
urlfetch.make_fetch_call(rpcDiagnosis, url)
except Exception,exD:
logging.error('Errors downloading health diagnosis content: %s' % exD)
#get hospital data
if (userLat and userLon):
hospitalData = self.getHospitalData(userLat, userLon,format)
if (hospitalData):
returnData += Formatter.dataComplex(format, 'hospital-records', hospitalData)
if (rpcClinicalTrials):
clinicalTrialsData = ''
try:
resultClinicalTrials = rpcClinicalTrials.get_result()
if (resultClinicalTrials and resultClinicalTrials.status_code == 200):
if (resultClinicalTrials.content):
clinicalTrialsData = self.getClinicalTrialsData(minidom.parseString(resultClinicalTrials.content), format)
else:
logging.error('unable to retrieve clinical trials content')
clinicalTrialsData = Formatter.data(format, 'error', 'Unable to retrieve content from provider')
except Exception,ex:
logging.error('Errors getting clinical trials content: %s' % ex)
clinicalTrialsData = Formatter.data(format, 'error', 'Error(s) retrieving content from provider: %s' % ex)