Пример #1
0
        if form_data.has_key("batch_size"):
            batch_size = int(form_data["batch_size"].value)
        for i in image_numbers[::batch_size]:
            start = i
            end = min(start + batch_size - 1, max(image_numbers))
            status_file_name = ("%s/status/Batch_%d_to_%d_DONE.mat" %
                                (batch["data_dir"], start, end))
            run = {
                "start": start,
                "end": end,
                "group": None,
                "status_file_name": status_file_name
            }
            batch["runs"].append(run)

    batch_id = RunBatch.CreateBatchRun(batch)

    email_text = []
    email_text.append("<html>")
    email_text.append("<head><title>Batch # %d</title>" % (batch_id))
    email_text.append("<style type='text/css'>")
    email_text.append("""
table {
    border-spacing: 0px;
    border-collapse: collapse;
}
td {
    text-align: left;
    vertical-align: baseline;
    padding: 0.1em 0.5em;
    border: 1px solid #666666;
Пример #2
0
     if error:
         exception = RuntimeError()
         exception.message = error
         raise exception
     #
     # This is somewhat dependent on internals, but we
     mrf = mat_reader_factory(batch_file, struct_as_record=True)
     batch_info = mrf.get_variables(['number_of_image_sets'])
     if batch_info.has_key('number_of_image_sets'):
         my_batch["num_sets"] = batch_info['number_of_image_sets'][0, 0]
     else:
         batch_info = loadmat(batch_file, struct_as_record=True)
         my_batch["num_sets"] = batch_info['handles']['Current'][
             0, 0]['NumberOfImageSets'][0, 0][0, 0]
     runs = PartitionBatches(my_batch)
     batch_id = RunBatch.CreateBatchRun(my_batch)
     results = RunBatch.RunAll(batch_id)
     text = []
     text.append("<html>")
     text.append("<head><title>Batch # %d</title>" % (batch_id))
     text.append("<style type='text/css'>")
     text.append("""
 table {
     border-spacing: 0px;
     border-collapse: collapse;
 }
 td {
     text-align: left;
     vertical-align: baseline;
     padding: 0.1em 0.5em;
     border: 1px solid #666666;