本文整理匯總了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)