当前位置: 首页>>代码示例>>Python>>正文


Python resultsimport.AnalysisResultsImporter类代码示例

本文整理汇总了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)
开发者ID:mas009,项目名称:Bika-LIMS,代码行数:7,代码来源:quantitative.py

示例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)
开发者ID:andersonsmith,项目名称:bika.lims,代码行数:64,代码来源:instrument.py


注:本文中的bika.lims.exportimport.instruments.resultsimport.AnalysisResultsImporter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。