本文整理汇总了Python中bika.lims.exportimport.instruments.resultsimport.AnalysisResultsImporter类的典型用法代码示例。如果您正苦于以下问题:Python AnalysisResultsImporter类的具体用法?Python AnalysisResultsImporter怎么用?Python AnalysisResultsImporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AnalysisResultsImporter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parser, context, idsearchcriteria, override,
allowed_ar_states=None, allowed_analysis_states=None,
instrument_uid=''):
AnalysisResultsImporter.__init__(self, parser, context, idsearchcriteria,
override, allowed_ar_states,
allowed_analysis_states,
instrument_uid)
示例2: GenericImport
def GenericImport(context, request, parser, importer=None):
infile = getResultsInputFile(request)
fileformat = getFileFormat(request)
artoapply = request.form['artoapply']
override = request.form['results_override']
sample = request.form.get('sample', 'requestid')
instrument = request.form.get('qcinstrument', None)
errors = []
logs = []
warns = []
# Load the most suitable parser according to file extension/options/etc...
if not hasattr(infile, 'filename'):
errors.append(_("No file selected"))
if parser:
# Load the importer
status = ['sample_received', 'attachment_due', 'to_be_verified']
if artoapply == 'received':
status = ['sample_received']
elif artoapply == 'received_tobeverified':
status = ['sample_received', 'attachment_due', 'to_be_verified']
over = [False, False]
if override == 'nooverride':
over = [False, False]
elif override == 'override':
over = [True, False]
elif override == 'overrideempty':
over = [True, True]
sam = ['getRequestID', 'getSampleID', 'getClientSampleID']
if sample == 'requestid':
sam = ['getRequestID']
if sample == 'sampleid':
sam = ['getSampleID']
elif sample == 'clientsid':
sam = ['getClientSampleID']
elif sample == 'sample_clientsid':
sam = ['getSampleID', 'getClientSampleID']
imp = importer
if not imp:
imp = AnalysisResultsImporter(parser=parser,
context=context,
idsearchcriteria=sam,
allowed_ar_states=status,
allowed_analysis_states=None,
override=over,
instrument_uid=instrument)
tbex = ''
try:
imp.process()
except:
tbex = traceback.format_exc()
errors = imp.errors
logs = imp.logs
warns = imp.warns
if tbex:
errors.append(tbex)
results = {'errors': errors, 'log': logs, 'warns': warns}
return json.dumps(results)