def ispyb_object(): assert os.path.exists("xia2.json") assert os.path.exists("xia2.txt") command_line = "" for record in open("xia2.txt"): if record.startswith("Command line:"): command_line = record.replace("Command line:", "").strip() xinfo = XProject.from_json(filename="xia2.json") crystals = xinfo.get_crystals() assert len(crystals) == 1 crystal = next(iter(crystals.values())) ispyb_hdl = ISPyBXmlHandler(xinfo) ispyb_hdl.add_xcrystal(crystal) return ispyb_hdl.json_object(command_line=command_line)
def ispyb_object(): from xia2.Interfaces.ISPyB.ISPyBXmlHandler import ISPyBXmlHandler assert os.path.exists("xia2.json") assert os.path.exists("xia2.txt") command_line = "" for record in open("xia2.txt"): if record.startswith("Command line:"): command_line = record.replace("Command line:", "").strip() xinfo = XProject.from_json(filename="xia2.json") crystals = xinfo.get_crystals() assert len(crystals) == 1 crystal = next(crystals.itervalues()) ISPyBXmlHandler.add_xcrystal(crystal) return ISPyBXmlHandler.json_object(command_line=command_line)
def ispyb_object(): from xia2.Interfaces.ISPyB.ISPyBXmlHandler import ISPyBXmlHandler import os assert os.path.exists('xia2.json') assert os.path.exists('xia2.txt') command_line = '' for record in open('xia2.txt'): if record.startswith('Command line:'): command_line = record.replace('Command line:', '').strip() from xia2.Schema.XProject import XProject xinfo = XProject.from_json(filename='xia2.json') crystals = xinfo.get_crystals() assert len(crystals) == 1 crystal = next(crystals.itervalues()) ISPyBXmlHandler.add_xcrystal(crystal) return ISPyBXmlHandler.json_object(command_line=command_line)